473,657 Members | 2,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't find an Event Handler

What I'm trying to do is find a way to determine at run time if a particular
event handler in a UserControl has been defined. Here's a snippet of code:

Public Event Button_Click As EventHandler

Public WriteOnly Property ButtonClick() As System.EventHan dler

Set(ByVal Value As System.EventHan dler)

If Not Value Is Nothing Then

AddHandler Me.Button_Click , Value

Me.HasButtonCli ck = True

End If

Console.WriteLi ne("Handler exists=" & Not (Me.Events(Me.B utton_ClickEven t)
Is Nothing))

End Set

The write statement prints out False, but the handler is in fact installed,
i.e., the event is handled by the event handler passed in is executed. Why
doesn't the Events list show the handler?

Ken
Nov 20 '05 #1
2 1159
* "Ken Kast" <ke*@NOSPAMkenk ast.com> scripsit:
What I'm trying to do is find a way to determine at run time if a particular
event handler in a UserControl has been defined. Here's a snippet of code:


<http://groups.google.c om/groups?selm=%23 AelgzK%23CHA.32 08%40TK2MSFTNGP 11.phx.gbl>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
I saw the Google posting and actually tried it first. I exception off
because GetInvocationLi st is Nothing (which I assume is equivalent to my not
finding the handler in Events). So I'm looking to solve one or the other of
the puzzles.

Ken

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:uZ******** ******@TK2MSFTN GP12.phx.gbl...
* "Ken Kast" <ke*@NOSPAMkenk ast.com> scripsit:
What I'm trying to do is find a way to determine at run time if a particular event handler in a UserControl has been defined. Here's a snippet of
code:
<http://groups.google.com/groups?selm...K2MSFTNGP11.ph
x.gbl>
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3

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

Similar topics

3
4033
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: oIE.Document.Forms("searchform").Item(<name>).Value = <myvalue> But I cannot control a dropdown with an onchange event. I can set the dropdown's value and selectedIndex, but then calling the onChange() or Click() does not do anything. It only seems to fire the onchange if I
39
6521
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. When it completes, it can call a success, or a failure function. The names of these success, or failure functions will differ, and I'd like to know how I can pass the name of a function to my tool, and how my tool can call the function, using that...
3
9824
by: Sushil Srivastava | last post by:
Hi Guys, Would you be able to help me using C# GUI (with user interface component) in my MFC application. I have used managed extension, COM-interops, etc but problem is this C# component has user interface. how should have get window handle from managed windows? Thanks in advance. Sushil
5
1908
by: Just Me | last post by:
Given a button name Btn_5 and Index=5 I want to do something like dim zz as string = Btn_??Index??.Text or given an array of buttons, do:
3
1958
by: Beth | last post by:
in the following: this.ExitButton.Click += new System.EventHandler(this.ExitButton_Click); if I saw an equation, such as y +=x; then y = y+x. But what is the meaning in the event handler. I realize it is adding an event handler for the click event of the exit button, but how do i reason through the 2 step process inferred by the += equation.
5
3606
by: Charles Bazi | last post by:
Hi, I have a base UserControl named UserControlEx. I have created an event, and a dummy handler. Then I create several UCs with UserControlEx base. Some of those have a handler for my custom event, others, no... I manage to have the list of events with EventInfo, but I'm unable to see if some event has a handler associated...
16
5005
by: Lastwebpage | last post by:
Hello, I am little surprised about the following: <a href="#" ... I found some lines about the href tag for a site should point to an name or in XHTML to an ID, but in both cases this seems to be not valid name="#" or id=""... And I wonder why the online validator allow this in all cases.DOCUMENT types.
2
3910
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite well, so at times it is tempting just to port parts of it over mostly as-is. In fact, one MSDN article I read suggested using straight HTML wherever possible to make the app more efficient and less resource demanding. On one page there are 2...
6
3893
by: =?Utf-8?B?L2Rldi9udWxs?= | last post by:
Hello, i am using visual studio 2003 enterprise architect version. I am making apps for the .Net framework 1.1. While testing an interface, i discovered something strange. In this application we have a standard toolbar that is at the top of the form window. It contains about 8 buttons that use images from an imagelist. Sometimes we hide buttons thru the code. When a button is hidden, i assumed that it wasn't clickable. It appears
0
8402
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8829
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
8734
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
8508
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
7341
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...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2733
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
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.