Event from Form to Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi al

I am trying the following
On a base form I open a new form with a treeview
On the base form, there are two buttons
Depending on the selection in the treeview on the new form, I like to enable or disable buttons on the base form

I do not like to declare and open forms as static. Would be nice if I can handl
this somehow with a delegates where I can pass parameters..

Hoping for some answers
Fran
 
Frank,
On the child form, you could declare public events that you want the parent
form to respond too (say, EnableButton1, EnableButton2). Then, when you
create a new instance of the child form (with the treeview on it), before
you call a Show method, bind to those events. Then, in the child form,
raise those events whenever the action occurs that should change the way the
buttons are shown. That will call back to the parent form and execute your
event handlers.

Ryan Gregg

Frank Uray said:
Hi all

I am trying the following:
On a base form I open a new form with a treeview.
On the base form, there are two buttons.
Depending on the selection in the treeview on the new form, I like to
enable or disable buttons on the base form.
 
Back
Top