Hi I want to develop program in Visual Basic 6, is a small program that lets you input any number from 1 to 5 and automatically display the corresponding number to its row. I have some screenshots i finish the design, my problem is the coding part. please help..here's my print screen screenshots. I have an screenshots below.
Sorry, I haven't looked at your code (you would be better just pasting the bit of code) but wouldn't you be better using the latest version of VB? You can download Visual Basic Studio 2010 Express for free from Microsoft. http://www.microsoft.com/express/downloads/
Private Sub Text1_Change() If Val(Text1.Text) = "5" Then val(text1.Text) = label5.caption End If End Sub i need the right code sir thanks....
Sorry buddy, I'm a bit rusty on vB6. You could try asking here if no-one has any suggestions: http://www.vbforums.com/forumdisplay.php?f=21
This is pretty simple. On the text change event just code it so that it checks for the input in the textbox. If it equals 1 to 5, then enter that in the corresponding textbox. You can use a case statement: Select Case youmaintextbox.text Case "1" textbox1.text = "1" Case "2" textbox2.text = "2" End Case Just add the cases for 3, 4, and 5. You can also do if/else statements like If youmaintextbox.text = "1" Then textbox1.text = "1" ElseIf youmaintextbox.text = "2" Then textbox1.text = "2" End If
A little correction: Select Case youmaintextbox.text Case "1" label1.caption = "1" Case "2" label2.caption = "2" Case "3" label3.caption = "3" Case "4" label4.caption = "4" Case "5" label5.caption = "5" End Case