Event from Form to Form

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
 
R

Ryan Gregg

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top