state of a panel, form??

  • Thread starter Thread starter Doug
  • Start date Start date
D

Doug

hello,

i have got a panel with several controls in it, including a button which is
disabled.
I want to enable this button whenever, any of the controls inside the panel
changes.

e.g. someone has typed in the textbox,
the datagrid has been edited,(a user edits or inserts a new cell)
a checkbox is checked.

Is there anyway to do this?

Thanks,

Doug
 
Hi doug,

Of course, I think now of two possibilities, one on the events handlers of
those controls ( checkbox, grid, textbox , etc ) enable the button ( you can
check some condition too ) . the other will be create a function where check
all the conditions under which it can be enabled, then add this method to
the handler of each of the controls, this second apprach may be a little
more difficult as you can have more than one signature of event handlers, so
maybe you have to cope with more than one method:
// NOT TESTED CODE
protected void CheckForGrid( object sender, DataGridCommandEventArgs e )
{
CheckGeneric(sender );
}
protected void CheckGeneric( object sender, EventArgs e )
{
CheckGeneric(sender );
}

protected void CheckGeneric( object sender)
{}


Hope this help,
 
Back
Top