Can't Grasp Visual Basic 2005 Express

Cromewell

Administrator
Staff member
Just put text in the box then use the onfocusgained event to clear the text out by setting the .text property to "". For a clear button do the same thing, set the .text property of your textboxes to "".
 
Just put text in the box then use the onfocusgained event to clear the text out by setting the .text property to "". For a clear button do the same thing, set the .text property of your textboxes to "".

In English?? Lol

What about a close button?
 
Last edited:

Cromewell

Administrator
Staff member
I thought that was english?

Every control has events that can trigger code. I might not have the event right, it might just be called OnFocus. VB2005 should have a list of events that it will insert automatically.
I think it will look like this:
Private Sub TextBox1_OnFocus (ByVal sender As Object, ByVal e As System.EventArgs)

End Sub

but if you double click the textbox on your form it will inster some sub automatically then look at the top of the IDE you will see the textbox name and to the right of that, the event. Click on the event drop down box and find the OnFocus one.

To make a quit button just put in "End" in the OnClick event for a command button.
 
Top