Click & Focus

  • Thread starter Thread starter Rochdi
  • Start date Start date
R

Rochdi

Hi guys, I was trying to use the Click, GotFocus and
LostFocus events for a textbox in VB.net but I couldn't
find them in the events list like VB, where can I find
them..!!?


Thanks
 
select the textbox in the left combo above your code and the events will be
in the right combo above your code

Private Sub txtTotMin_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles txtTotMin.Click

End Sub

Private Sub txtTotMin_GotFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles txtTotMin.GotFocus

End Sub

Private Sub txtTotMin_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles txtTotMin.LostFocus

End Sub

hope it helps

eric
 
* "Rochdi said:
Hi guys, I was trying to use the Click, GotFocus and
LostFocus events for a textbox in VB.net but I couldn't
find them in the events list like VB, where can I find
them..!!?

You can show advanced members in the code editor with the "Hide advanced
members" option under "Tools" -> "Options" -> "Text Editor" -> "Basic"
-> "General".
 
I've tried that, but I couldn't found them; in VB they are
very clear but vb.net I couldn't found them.
And I've tried to Tick and untick the "Hide advanced
members" option under "Tools" -> "Options" -> "Text
Editor" -> "Basic"-> "General", but it didn't work
either...!!!!
 
Hi Rochdi,

We start trying to find them again I am sure Eric is not looking at the
weekend.

The are only visible if there is a code page visible.
Then direct above the code (so not in a form) you see 2 comboboxen.
There is nothing written with it, but they are direct under the tabs of the
tabcontrol.

Left you can choise the control, the form itself is frmxxxx events

Right you can choise an event, the behaviour is as far as I remember me than
the same as VB6.

I hope this helps to find it?

Cor
 
I don't what version are you using guys, but I am using
Visual Studio .Net 2002 (the complete version), and I will
describe for you what I am seeing in the code page; in the
left combo the controls(form1, textbox1...etc) and in the
right combo the word Declaration, and for the textbox1 I
couldn't find the Click (not DoubleClick), GotFocus,
LostFocus like in VB6, so what I'm missing here..!!!?
 
Hi Rochdi,

Are you making your controls dynamicly, than you have to declare them with
events something as (Private withevents as textbox) to see them

When you drag them on your form (what most people in simple situations do)
they are there automaticly, because then that is done for you.

I hope I got it now?

Cor
 
* "Rochdi said:
I don't what version are you using guys, but I am using
Visual Studio .Net 2002 (the complete version), and I will
describe for you what I am seeing in the code page; in the
left combo the controls(form1, textbox1...etc) and in the
right combo the word Declaration, and for the textbox1 I
couldn't find the Click (not DoubleClick), GotFocus,
LostFocus like in VB6, so what I'm missing here..!!!?

And what if you add the handlers by hand by typing in the code?
 
I don't know what you mean by making them dynamically, but
all what I'm doing is exactly like I use to do in VB:
- start a new project.
- click and drag a textbox control in the form.
- go to the code page.
- select the textbox control from the left combo.
and in the right combo there are may events, but I can't
find some events such as Click, GotFocus, LostFocus like
VB
and when I created one just by typing the following:
Private Sub TextBox1_Click(ByVal sender As System.Object,
By e As System.EventArgs) Handlers TextBox1.Click

End Sub

actually it's working!!!
 
hmm are you sure you are selecting a control in the left cbo first (the
events wont show untill you select the control)

if this is not working there could be something wrong w your options (not
that i know of options to remove events) or w your installation of vs :/
 
-----Original Message-----
hmm are you sure you are selecting a control in the left cbo first (the
events wont show untill you select the control)
Yes!

if this is not working there could be something wrong w your options (not
that i know of options to remove events) or w your
installation of vs :/

Do you know what option should I turn on!!? because I
tried the "Hide advanced members" option under "Tools" -
"Options" -> "Text Editor" -> "Basic"-> "General", but
it didn't work!!!
 
Back
Top