![]() |
Accesing Control Properties on Another Form
I'm trying to enable a button on the main form, once the child form is closing. I'm using a MDI here, and I noticed that if I do this by a button click on the child form it works. But it aint happening if i use the FormClosing or FormClosed events.
Please Help |
Re: Accesing Control Properties on Another Form
Does an instance of the main form not already exist? is that not where the child forms are hosted?
Creating a new instance of the main form and setting the enabled state of the button of that instance will not have an effect on the form already shown. Try looking into the forms 'Parent' property and take it from there. |
Re: Accesing Control Properties on Another Form
your best bet here is probably to create a public property on the child form that is set according to user input into the child form. Then, after you close the child form, you can check this property from the main form.
|
Re: Accesing Control Properties on Another Form
How would it be best to declare, reference and use new variables for this task when it could be done with a simple cast?
Imagine... :
|
Re: Accesing Control Properties on Another Form
Quote:
|
Re: Accesing Control Properties on Another Form
Should be something along the lines of:
:
Me.Parent.Controls("tsbSuppliers").enabled = falseGive that a try. If it doesn't work there, try it in the child form's Disposing event. |
| All times are GMT -5. The time now is 9:12 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC