473,396 Members | 1,963 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,396 software developers and data experts.

Addhandler with parameter ?

Is it possible to add a handler , and the function to add has a parameter ?

Or MUST the function have NO parameters ?
Thanks
Peter
Apr 21 '06 #1
3 16816
Not sure what you mean. Keep in mind that when using addhandler, you just
tell which method to call. You don't perform an actual call. This is why you
never have to specify which parameters to use in this context.

If this is not the problem, your best bet is to just show us directly what
you tried so that we can understand the problem you have...
--
Patrice

"Peter Stojkovic" <ds*@gmx.net> a écrit dans le message de news:
Os****************@TK2MSFTNGP02.phx.gbl...
Is it possible to add a handler , and the function to add has a parameter
?

Or MUST the function have NO parameters ?
Thanks
Peter

Apr 21 '06 #2
To add to what Patrice already explained, here is some sample code :
-------------------------------------
AddHandler Button1.Click, AddressOf ClickHandler
AddHandler Button2.Click, AddressOf ClickHandler

Private Sub ClickHandler (ByVal sender As System.Object, e As _
System.EventArgs)
' Your code here.
End Sub
-------------------------------------

In VB.NET, Event Handlers are Subs, not Functions, so they can't return
values. This however has no implication on whether they accept
parameters or not. In my example, the EventHandler method takes 2
parameters.

HTH,

Regards,

Cerebrus.

Apr 21 '06 #3
"Peter Stojkovic" <ds*@gmx.net> schrieb:
Is it possible to add a handler , and the function to add has a parameter
?


No problem. You do not need to list the function's signature when adding it
as a handler.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 21 '06 #4

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

Similar topics

7
by: UGH | last post by:
I am adding image buttons dynamically and I need to add event handler when the user clicks on one of those image buttons which will have different id for reports. Here is my code LnkImage =...
4
by: DJ | last post by:
Good morning, Still new at this so please bear with me. I am creating a table dynamically using webcontrols based on the output of a sproc from my database.The table represents test instances...
2
by: MLS | last post by:
The documentation on dynamic handlers comes across as abiguous. Perhaps somebody could help set me straight? I have a situation where I need to dynamically create several usercontrols of the...
7
by: Richard Grant | last post by:
Hi. In c/C++ i can pass the address of a subroutine to another subroutine as an actual parameter How do I do that in VB .NET What should be the syntax for a parameter to receive the address of a...
2
by: bdring | last post by:
I have a collection of objects. The objects gather data from separate sources. Once they get data they raise an event called GotData. I want the collection to raise an event whenever any of it's...
1
by: myregid | last post by:
I am developing an application which used DigitalPersona gold SDK 2.4 under VB.net 2003. ---------------------------------------------------------- api in C++ ¡¾FT_startMonitoringDevice¡¿...
3
by: Vassili King | last post by:
Hi: I was wondering if anybody had a similar problem and could help me out with a situation I ran into. I would really appreciate any advice. I've created an .aspx page for my Web Application...
2
by: GAZ | last post by:
Hello all, We have a bit of a problem. We have a form where we have to add controls dynamically during runtime. That part is quite simple. Now, we have to add a ButtonClick event for each of the...
0
by: pankajprakash | last post by:
Hi all I am using the Ajax control toolkit and want to the fill the gridview but at the time of rendering it occurs the error "Sys.ArgumentNullException: Value cannot be null. Parameter name:...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.