HighTechTalks DotNet Forums  

Silly question

VB.net microsoft.public.dotnet.languages.vb


Discuss Silly question in the VB.net forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Jenny
 
Posts: n/a

Default Silly question - 04-18-2004 , 03:06 PM






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

Reply With Quote
  #2  
Old   
Armin Zingler
 
Posts: n/a

Default Re: Silly question - 04-18-2004 , 03:44 PM






"Jenny" <anonymous (AT) discussions (DOT) microsoft.com> schrieb
Quote:
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.

Quote:
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



Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: Silly question - 04-18-2004 , 03:56 PM



* "Rob Oldfield" <rob@oldfield100_wow_freeserve_yikes_co_incredible !_uk> scripsit:
Quote:
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.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


Reply With Quote
  #4  
Old   
Brian Henry
 
Posts: n/a

Default Re: Silly question - 04-18-2004 , 05:21 PM



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" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
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,
Quote:
I cannot dseem to perform this same thing with vb.net
You guys care to give me some insight here



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.