objects in event handlers

20 views
Skip to first unread message

Andrei

unread,
Oct 18, 2010, 5:23:14 AM10/18/10
to SSharp
Hello,

I am trying to access a control from an event handler.
It doesn’t work. It seems like I cannot access controls in event
handlers.
For what I am trying to do, this represents a problem.

function OnClick(s,e)
{
MessageBox.Show(Button1.Name);
}

Button2.Click += OnClick;


How to make the event handler to be able to use the Button1 object?

Thank you.


piter....@gmail.com

unread,
Oct 18, 2010, 9:38:07 AM10/18/10
to SSharp
Reply all
Reply to author
Forward
0 new messages