showing code in vb2005

  • Thread starter Thread starter Web Search Store
  • Start date Start date
W

Web Search Store

Hello,

Just started with vb2005.

In the old vb6, you could click on a button, and it would bring you right to
the code for that button.

In this new one, it takes you to some code, but doesn't seem to give you a
blank template for the button on which to work.

Or for existing buttons, it doesn't take you to the code for that button.

Am I missing something?

Thanks for the help.

Scott
 
Hello,

Just started with vb2005.

In the old vb6, you could click on a button, and it would bring you right to
the code for that button.

In this new one, it takes you to some code, but doesn't seem to give you a
blank template for the button on which to work.

Or for existing buttons, it doesn't take you to the code for that button.

Am I missing something?

Thanks for the help.

Scott

Double click on a object like a button that must bring you to
button1.click event sub code block by default as well as other
controls and their default events.
 
Web Search Store said:
Just started with vb2005.

In the old vb6, you could click on a button, and it would bring you right
to
the code for that button.

In this new one, it takes you to some code, but doesn't seem to give you a
blank template for the button on which to work.

Or for existing buttons, it doesn't take you to the code for that button.

This should work like in VB6. Does the problem even occur on a blank
project? Is your project a Windows Forms project?
 
Maybe you have your button click events signed up to a different event name.
Double-clicking on the button in design mode SHOULD take you to code-behind,
and if it's not hooked up yet, it should add the appropriate method with the
right signature.

Another place to look is in the Properties window for your control, click on
the lightning bolt to the right of the list icon. This shows most of the
events available. (Not all, because in C# it doesn't show the LostFocus
events for textboxes. At least, mine doesn't).

Anyway, you can scroll down the list and see what routine is running for
each event, like the ClickEvent. And to add one, you can double-click on the
blank space on the right and it will add the method for you with the
signature. You can also double-click on the method name if displayed, and it
will take you there.

Does that help?

RobinS.
GoldMail, Inc.
 
Maybe you have your button click events signed up to a different event name.
Double-clicking on the button in design mode SHOULD take you to code-behind,
and if it's not hooked up yet, it should add the appropriate method with the
right signature.

Another place to look is in the Properties window for your control, click on
the lightning bolt to the right of the list icon. This shows most of the
events available. (Not all, because in C# it doesn't show the LostFocus
events for textboxes. At least, mine doesn't).

Anyway, you can scroll down the list and see what routine is running for
each event, like the ClickEvent. And to add one, you can double-click on the
blank space on the right and it will add the method for you with the
signature. You can also double-click on the method name if displayed, and it
will take you there.

Does that help?

RobinS.
GoldMail, Inc.

In addition, always look for "handles.<event>" for proper event
assignment for your object's sub where event is "click" for your
button by default.
 
In addition, always look for "handles.<event>" for proper event
assignment for your object's sub where event is "click" for your
button by default.

Sample:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
'Your code here
End Sub

You can name sub anything like xyz_click or xyz whatsoever, but make
make sure "handles Button1.Click" is fired for your purpose which may
be deceptive.

Hope this helps.
 
Hello,

You know, I was clicking on a button, then hitting f7 key. I find that if
I double click on the actual button, it does take me to the code.

Thanks for your help! I think the subtle difference may be that vb6 took me
to the button code when I hit f7, it doesn't seem to in vb2005.

So, I have succeeded in getting the functionality I wanted.

Thanks

Scott
 
Back
Top