current possition

L

Lal - Luxor

dear all,
one of my form have 3 text boxes and 1 button
i want to trap my cursor on which text box
please help me

regards with thanks

lal
 
H

Herfried K. Wagner [MVP]

Lal - Luxor said:
one of my form have 3 text boxes and 1 button
i want to trap my cursor on which text box

I feel sorry, but I don't understand what you want to archieve. Can you
describe in more detail what you want to do?
 
L

Lal

on my form have 3 text boxes which is reprenting 3 differert tables
insted of i am putting 3 different buttons i want to put a single button and
if the cursor on the textbox1 then i want to open another form1, and if the
cursor in textbox2 then i want form2 and the same in textbox3 also
ie. on the click event of the button i want to trap the cursor on which
text box.

regards

lal
 
R

Ritesh Jain via DotNetMonster.com

Hi,
I don't know whether this is optimize solution or not but u can Have a Enum which will keep the Track of Last Focused TextBox.

e.g
Public Enum tbFOcus
tb1 = 1
tb2 = 2
tb3 = 3
End Enum
Private pi_enumFocus As tbFOcus

Set the Value of pi_enumFocus in TextBox's Enter Event as

Private Sub TextBox1_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Enter
pi_enumFocus = tbFOcus.tb1
End Sub

and in Button's Click event u can get

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show("Last Focus was on " & pi_enumFocus)
End Sub

I hope this will help u............

Regards,
Ritesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top