Silly question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi you al
I have two very silly question
The first one is
In vb 6.0 you can add a procedure, sub or function, by clicking add procedure from the tools item on the menuba
I cannot seem to find this in vb.net 2003 SV.
My questions is do you have to manual enter the code to create a procedure yoursel
And my sencond question
Again in vb6 you can call a meun item from code like call mnuNew_Click and your application would respone as if you had click on the New menuitem in you app
I cannot dseem to perform this same thing with vb.net
You guys care to give me some insight here
 
For 'event' subs for controls on forms you can select the control from the
left hand drop down, and then choose the event in the right hand drop down.

For form events it's similar but there's an option near the top of the left
hand drop down. In VS 2002 (which is what I have in front of me at the
moment) it's "(Base Class Events)" but it's similar in VS 2003. Once you've
picked that you can get at things like the Load and Closing events from the
right hand drop down.

I don't think there's a way to autogenerate stand-alone subs and functions.
I've always just typed them for myself.


Jenny said:
Hi you all
I have two very silly questions
The first one is:
In vb 6.0 you can add a procedure, sub or function, by clicking add
procedure from the tools item on the menubar
I cannot seem to find this in vb.net 2003 SV.
My questions is do you have to manual enter the code to create a procedure yourself
And my sencond question:
Again in vb6 you can call a meun item from code like call mnuNew_Click and
your application would respone as if you had click on the New menuitem in
you app,
 
Jenny said:
Hi you all
I have two very silly questions
The first one is:
In vb 6.0 you can add a procedure, sub or function, by clicking add
procedure from the tools item on the menubar I cannot seem to find
this in vb.net 2003 SV. My questions is do you have to manual enter
the code to create a procedure yourself

Write
sub x <enter>

and you have a new procedure. That's all. The editor creates the End Sub for
you (if option enabled). I don't know why you need a menu item for this.
It's faster typed then the menu item selected. All other things (arguments,
return type for functions) you have to write on your own anyway.
And my sencond question:
Again in vb6 you can call a meun item from code like call
mnuNew_Click and your application would respone as if you had click
on the New menuitem in you app, I cannot dseem to perform this same
thing with vb.net You guys care to give me some insight here

The purpose of an event handler is handling an event, which means that the
procedure is called when the event occurs. You shouldn't call it because the
event didn't occur. Instead, call a procedure that is also called in the
event handler.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
* "Rob Oldfield said:
I don't think there's a way to autogenerate stand-alone subs and functions.
I've always just typed them for myself.

ACK. Currently, that's not possible "out of the box" in VB.NET.
 
in .net you need to create functions and subs by writing them in the code
window.. this is standard programming sequences... in the past VB hid this
from you..

to make a funciton type

[PUBLIC | PRIVATE | PROTECTED] Function FUNCTIONNAME([Param list]) AS TYPE

subs are the same

to handle events like clicks and such you need to do this, make a sub that
will handle the event, then where you start the application do an AddHandler
item to point it to that sub that handles that event.. this is similar to
MFCish programming where you create event handlers


Jenny said:
Hi you all
I have two very silly questions
The first one is:
In vb 6.0 you can add a procedure, sub or function, by clicking add
procedure from the tools item on the menubar
I cannot seem to find this in vb.net 2003 SV.
My questions is do you have to manual enter the code to create a procedure yourself
And my sencond question:
Again in vb6 you can call a meun item from code like call mnuNew_Click and
your application would respone as if you had click on the New menuitem in
you app,
 
Back
Top