473,763 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dumb IDE Question - Inserting an Event Handler

With the rich IDE on VB.net 2003, I was wondering if there is an easy way to
set the event handler function for a hand-coded object (SqlConnection for
example). I know that if I dim it withevents I can use the drop-down to
insert the event-handler template. But if I am not using the withevents, but
instead wiring things with the addhandler command, is there a way to get the
template inserted? Right now I am putting a 'dim withevents ..... as new
.....' just so I can get the event handler function template and then
deleting the 'dim withevents .... '

Just curious.

TIA

Marcus
Jul 19 '05 #1
2 2226
After the object is set you can use "AddHandler " to handle the object's
events rather then dim withevents
"Marcus Smaby" <mr*****@msn.co m> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
With the rich IDE on VB.net 2003, I was wondering if there is an easy way to set the event handler function for a hand-coded object (SqlConnection for
example). I know that if I dim it withevents I can use the drop-down to
insert the event-handler template. But if I am not using the withevents, but instead wiring things with the addhandler command, is there a way to get the template inserted? Right now I am putting a 'dim withevents ..... as new
....' just so I can get the event handler function template and then
deleting the 'dim withevents .... '

Just curious.

TIA

Marcus

Jul 19 '05 #2
Hello Marcus,

As you know (also suggested by Mike), the Handles/WithEvents keyword and
the AddHandler statement are two common methods to create an event handler.
Based on my experience and research, I did not aware thre is other easier
way.

In the meantime, I believe the following KB article is helpful:
Writing Event Handlers
http://msdn.microsoft.com/library/de...us/vbcn7/html/
vaconwritingeve nthandlers.asp

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8564
by: MC D | last post by:
I am trying to move my Main() procedure out of a startup form and into it's own class. I've updated the app settings to use the "Globals" class (which contains the main form). Here's what I have: static void Main() { Application.Run(); frmSplash splashForm = new frmSplash(); splashForm.Show();
2
241
by: Marcus Smaby | last post by:
With the rich IDE on VB.net 2003, I was wondering if there is an easy way to set the event handler function for a hand-coded object (SqlConnection for example). I know that if I dim it withevents I can use the drop-down to insert the event-handler template. But if I am not using the withevents, but instead wiring things with the addhandler command, is there a way to get the template inserted? Right now I am putting a 'dim withevents ........
20
1522
by: James | last post by:
I am new to vb.net (I am an old vb6 programmer). I cannot figure out an easy way to watch variables. In vb6 all I did was right click and could chose to stop execution when a variable chances as well as how extensive a "universe" (context) I want it to watch. In .net I must work in debug mode but I do not see how to stop execution when a variable changes nor controlling how brad a context I wish to watch. Any help would be appreciated
8
1303
by: Keith Rebello | last post by:
I have a program whose main form has a picture box on which concrete column sections are drawn. Input to the drawing is achieved by filling in data in various dialog boxes (called by using Form.Showdialog). When a dialog box is closed the drawing on the picture box is updated. Everything works fine when I run the program from the VS2005 IDE. However, when I run the program by clicking on the .exe outside the IDE, I have to keep...
0
9389
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10149
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10003
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9943
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9828
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8825
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7370
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5410
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3918
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.