| | |
Press enter to mark answer
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Feb 2009
Posts: 12
Reputation:
Solved Threads: 0
hi all
i am using VB6 and is writing a code for a maths project. learners have to enter an answer into a textbox and press enter to mark the given answer. i am currently using a command button to mark the answer, but it is time consuming. the idea is to do as many sums as possible in a limited time span.
thank you
Ta'Nick
i am using VB6 and is writing a code for a maths project. learners have to enter an answer into a textbox and press enter to mark the given answer. i am currently using a command button to mark the answer, but it is time consuming. the idea is to do as many sums as possible in a limited time span.
thank you
Ta'Nick
I think you want to add events in key press.In this case the simple and easy way is to add this code :
Here you can call an even in key press and compare the Key pressed with the key you want ....
And if you want to clean the text after that just add this line
Try it....
Best of luck ....
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = vbKeyReturn Then Label1.Caption = Text1.Text End If End Sub
And if you want to clean the text after that just add this line
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Text1.Text = ""
Best of luck ....
Who wants to be a GOD ??
•
•
Join Date: Mar 2009
Posts: 912
Reputation:
Solved Threads: 167
Without having to change any of your code you can still accomplish what you want. In the forms design view, highlight the button and then goto its properties. Find the "default" property and make it true.
This property tells the OS that this button is the default button to press when user hits enter key.
Good Luck
This property tells the OS that this button is the default button to press when user hits enter key.
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
•
•
Join Date: Feb 2009
Posts: 12
Reputation:
Solved Threads: 0
Thank you very much. it works like magic.
•
•
•
•
hi all
i am using VB6 and is writing a code for a maths project. learners have to enter an answer into a textbox and press enter to mark the given answer. i am currently using a command button to mark the answer, but it is time consuming. the idea is to do as many sums as possible in a limited time span.
thank you
Ta'Nick
![]() |
Similar Threads
- Disk boot failure, insert system disk and press enter (Troubleshooting Dead Machines)
- Disk Boot Error, Insert System Disk And Press Enter (Storage)
- What is this symbol in IDEAL when I press enter? (Python)
- "Press enter to go back" (C)
- i want the user to enter an input without obligating him to press enter (C++)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: how to solve this
- Next Thread: Error "Provider not found"
Views: 429 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





