Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Controls on Form dispose 1

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
When a user clicks the X button to close the form or clicks an exit button I have on a menu, the dispose event handler is fired.

At this stage, I would like to be able to loop through the controls in my tablelayoutpanel and perform some DB updates. However, it fails saying that it can't find the field.

Is this because controls cannot be accessed after the form has been disposed? I can get the rowcount of the tablelayoutpanel but can't seem to access the controls within it.

How do I go about this?

Mighty
 
Have you looked at the FormClosing event? Everything should still be available to you before the Dispose fires.

--------------------------------------------------
“Crash programs fail because they are based on the theory that, with nine women pregnant, you can get a baby a month.” --Wernher von Braun
--------------------------------------------------
 
That worked a treat - thanks

Mighty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top