473,385 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 2202
After the object is set you can use "AddHandler" to handle the object's
events rather then dim withevents
"Marcus Smaby" <mr*****@msn.com> wrote in message
news:%2****************@tk2msftngp13.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/
vaconwritingeventhandlers.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
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:...
2
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...
20
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...
8
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.