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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control forms controls without loading the form

Status
Not open for further replies.

ChrisN

Programmer
Jul 9, 2001
59
GB
Is it possible to manipulate the state of controls displayed on a form without actually loading the form?

I have a number of forms with Chinese and English labels on them. If the user requests a change of language I need some controls to be visible and others to be invisible.

Can anyone help?

Cheers,
Chris
 
Unfortunately you can't manipulatew controls on a form without loading the form (they don't exist until the form is loaded). You can load the form without displaying it, though (just use the code Form1.Load as opposed to Form1.Show where Form1 is the form name). If you do that, the Form_Load event does still fire, so you need to be aware of that. A round about way to do what you want is to have some global "setting variables" in a module (they can't be on the form because, just like the controls, the variables for the form don't exist until it is loaded). You can manipulate those variables in your other form(s), and when you load the new form just check those "setting variables" in your Form_Load routine to make whatever changes you need to the control settings.

I hope that helps. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top