Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2005

Tip: Looking for answers? Try searching our database.

How to pass an EventArgs to OnClick upon clicking a control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nima - 18 Feb 2005 21:17 GMT
Hi all,

When you click a control, OnClick is called which in turn calls the Click
event.  OnClick takes as an argument an object of type EventArgs which it
then passes to Click.  However, the default behavior is that the EventArgs
that is sent is an empty one.  I want to pass in some values in my EventArgs
when the user clicks my control.  How do I do this?

Thanks,

Nima
Sean Hederman - 19 Feb 2005 04:14 GMT
Override OnClick
> Hi all,
>
[quoted text clipped - 4 lines]
> EventArgs
> when the user clicks my control.  How do I do this?

Override OnClick:

protected virtual OnClick(EventArgs e) {    // e will be EventArgs.Emppty
   MyEventArgs eventArgs = new MyEventArgs();
   base.OnClick(eventArgs);
}

> Thanks,
>
> Nima

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.