PC Review


Reply
Thread Tools Rate Thread

What Button Was Clicked ??

 
 
Charles A. Lackman
Guest
Posts: n/a
 
      23rd Aug 2004
Hello,

I have a project with multiple child forms (created from DLLs). When a
button in the child form is clicked the Parent form needs to know what
button was clicked. Any Suggestions will be greatly appreciated.

Thanks,

Chuck


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      23rd Aug 2004
Charles,

Never did this, however I think I would create a property in every mdi child
form form that I would fill when there was a button clicked in the events
something as this. Roughly typed, not tested just a gues.
\\\
Private lButton As Button
Public ReadOnly Property Lastbutton() As Button
Get
Return lButton
End Get
End Property
Button Click event
lButton = sender
end sub
///
That can be seen in the parent with mymdiform.Lastbutton.name

I hope this helps?

Cor


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      23rd Aug 2004
* "Charles A. Lackman" <(E-Mail Removed)> scripsit:
> I have a project with multiple child forms (created from DLLs). When a
> button in the child form is clicked the Parent form needs to know what
> button was clicked. Any Suggestions will be greatly appreciated.


Define an event in your child form and add a handler to this event in
the main form. Then you can pass the reference to the control that
raises the event in the 'sender' parameter of your event.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
 
Reply With Quote
 
David Jessee
Guest
Posts: n/a
 
      25th Aug 2004
I Agree. Do a web search for "Observer Pattern"

"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> * "Charles A. Lackman" <(E-Mail Removed)> scripsit:
> > I have a project with multiple child forms (created from DLLs). When a
> > button in the child form is clicked the Parent form needs to know what
> > button was clicked. Any Suggestions will be greatly appreciated.

>
> Define an event in your child form and add a handler to this event in
> the main form. Then you can pass the reference to the control that
> raises the event in the 'sender' parameter of your event.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Button Text Gets Smaller When Button Clicked On Barb Reinhardt Microsoft Excel Programming 0 18th Mar 2009 01:31 PM
Inconsistent behavior of an asp.net button performing a postback when a button is clicked. Mossman Microsoft ASP .NET 0 12th Dec 2005 02:55 AM
What Button Was Clicked ?? Charles A. Lackman Microsoft Dot NET Framework Forms 3 25th Aug 2004 06:02 AM
Pause macro, add form button to sheet, continue macro when button clicked! Flystar Microsoft Excel Programming 1 26th May 2004 09:45 AM
Button Collection for Toolbar WebControl - Determinine which button was clicked Jim Mitchell Microsoft Dot NET 0 12th Jul 2003 02:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:33 PM.