Evaluare utilizator: 0 / 5

Steluță inactivăSteluță inactivăSteluță inactivăSteluță inactivăSteluță inactivă
 

In this video tutorial you will learn how to move cursor to one of the form's controls using Focus method. To do this I used an application from previous video tutorial and I added a new code line that will move the cursor to first Text Box control of the form.

{jcomments on}

 Focus code:

PublicClassForm1

   PrivateSub btnDisplay_Click(sender AsObject, e AsEventArgs) Handles btnDisplay.Click

       txtDisplay.Text = txtName.Text & ", " & txtAddress.Text

   EndSub

   PrivateSub btnNext_Click(sender AsObject, e AsEventArgs) Handles btnNext.Click

       txtName.Clear()

       txtAddress.Clear()

       txtDisplay.Clear()

       'Give the focus to txtName

       txtName.Focus()

   EndSub

   PrivateSub btnExit_Click(sender AsObject, e AsEventArgs) Handles btnExit.Click

       Me.Close()

   EndSub

EndClass