![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Nov 2007
Posts: 2
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Oct 2007
Posts: 29
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#3 |
|
Caffeinated Neural Net
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 864
Rep Power: 3
![]() |
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.
__________________
A man's knowledge is like an expanding sphere, the surface corresponding to the boundary between the known and the unknown. As the sphere grows, so does its surface; the more a man learns, the more he realizes how much he does not know. Hence, the most ignorant man thinks he knows it all. - L. Sprague de Camp |
|
|
|
|
|
#4 |
|
Newbie
Join Date: Oct 2007
Posts: 29
Rep Power: 0
![]() |
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... VB.NET Syntax (Toggle Plain Text)
|
|
|
|
|
|
#5 | |
|
Caffeinated Neural Net
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 864
Rep Power: 3
![]() |
Re: Accesing Control Properties on Another Form
Quote:
__________________
A man's knowledge is like an expanding sphere, the surface corresponding to the boundary between the known and the unknown. As the sphere grows, so does its surface; the more a man learns, the more he realizes how much he does not know. Hence, the most ignorant man thinks he knows it all. - L. Sprague de Camp |
|
|
|
|
|
|
#6 |
|
18 Year Old Programmer
Join Date: Jan 2008
Posts: 26
Rep Power: 0
![]() |
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Show or hiding forms/modifying control properties ..from different a form.. | cloud- | C# | 4 | Nov 10th, 2006 10:51 AM |
| .NET Timer Form closing issue | MBirchmeier | C# | 4 | Nov 21st, 2005 10:00 AM |
| entering data into excel from a form | glevine | Perl | 1 | Nov 18th, 2005 5:03 PM |
| Button to a form | JaDa64 | Visual Basic .NET | 17 | Jul 3rd, 2005 3:27 PM |
| Sending a web form as parameter | see07 | C# | 4 | Mar 24th, 2005 9:25 PM |