By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,344 Members | 1,114 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,344 IT Pros & Developers. It's quick & easy.

What Button Was Clicked ??

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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
Nov 21 '05 #2

P: n/a
* "Charles A. Lackman" <Ch*****@CreateItSoftware.net> 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/>
Nov 21 '05 #3

P: n/a
I Agree. Do a web search for "Observer Pattern"

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2o************@uni-berlin.de...
* "Charles A. Lackman" <Ch*****@CreateItSoftware.net> 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/>

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.