C Board  

Go Back   C Board > General Programming Boards > C# Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 10-18-2009, 10:30 AM   #1
Registered User
 
Join Date: Jul 2007
Posts: 7
how to read property of external form?

Hello, well basically, i created a windows form application when i started my project and i have created two extra forms (options and about). The options tab has a few checkbox's like: minimize to tray and top-most program and in my main form i have the code:

Code:
 if (this.WindowState == FormWindowState.Minimized == true)
 {
     notifyIcon1.Visible = true;
     this.WindowState = FormWindowState.Minimized;
     this.ShowInTaskbar = false;
 }

but i want to do something like

Code:
 if (this.WindowState == FormWindowState.Minimized == true && Options.checkBox1.Checked == true)
 {
     notifyIcon1.Visible = true;
     this.WindowState = FormWindowState.Minimized;
     this.ShowInTaskbar = false;
 }
but i can't find a way to read the properties of the controls on form3(Options), i tried changing the controls in the designer code portion of the form from private to public, but still no success. I would really appreciate any help on this topic. Thanks in advance.
Look- is offline   Reply With Quote
Old 10-18-2009, 01:37 PM   #2
Registered User
 
valaris's Avatar
 
Join Date: Jun 2008
Location: RING 0
Posts: 462
Do you have an object of the form in scope to be able to call? Usually I prefer to update some global Settings or Preferences structure that my application can pull from, so I don't keep checking the forms controls.

If you indeed have your controls public (which is not the best way to retrieve data), then there should be no reason you can't call members of it.
valaris is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
read only folder on Windows George2 Windows Programming 2 11-05-2007 09:18 AM
Installing Direct X bumfluff Game Programming 36 11-15-2006 07:18 PM
C++ std routines siavoshkc C++ Programming 33 07-28-2006 12:13 AM
My UserControls dissapear off my form zMan C# Programming 2 09-15-2004 08:55 AM
Unknown Memory Leak in Init() Function CodeHacker Windows Programming 3 07-09-2004 09:54 AM


All times are GMT -6. The time now is 11:15 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22