Control forms of an app
-
I have a main form for entry purposes shown in the taskbar. After I click on the OK button it starts a class method routine opening a status form. This should not be shown in taskbar. After doing some operation this window should automatically close. Question: If I switch back to my application in taskbar, I would like to get shown the status form and not the main form. What I've tried: 1. Opening status form with ShowDialog method. + Switching to the application shows the status form - All following operations are halted until status form is closed 2. Set TopMost attribute + switching to the application shows the status form - Status form's always on top 3. Opening status form with Show method + All following operations are running afterwards - Switching to the application shows the main window
-
I have a main form for entry purposes shown in the taskbar. After I click on the OK button it starts a class method routine opening a status form. This should not be shown in taskbar. After doing some operation this window should automatically close. Question: If I switch back to my application in taskbar, I would like to get shown the status form and not the main form. What I've tried: 1. Opening status form with ShowDialog method. + Switching to the application shows the status form - All following operations are halted until status form is closed 2. Set TopMost attribute + switching to the application shows the status form - Status form's always on top 3. Opening status form with Show method + All following operations are running afterwards - Switching to the application shows the main window
Try handling the main form's Activated event and activating the status form instead. Alternatively, adjust your design so if the user's supposed to be able to keep editing on the main form, a summary of the status is available on that form (status line? a panel that appears like Visual Studio's error pane?).
-
I have a main form for entry purposes shown in the taskbar. After I click on the OK button it starts a class method routine opening a status form. This should not be shown in taskbar. After doing some operation this window should automatically close. Question: If I switch back to my application in taskbar, I would like to get shown the status form and not the main form. What I've tried: 1. Opening status form with ShowDialog method. + Switching to the application shows the status form - All following operations are halted until status form is closed 2. Set TopMost attribute + switching to the application shows the status form - Status form's always on top 3. Opening status form with Show method + All following operations are running afterwards - Switching to the application shows the main window
Hi, From your posting I think that you want to show the main form in taskbar and not the status form when it displayed. To solve this issue try setting parent property of the status form. Hope this helps. Nitheesh George http://www.simpletools.co.in
-
Hi, From your posting I think that you want to show the main form in taskbar and not the status form when it displayed. To solve this issue try setting parent property of the status form. Hope this helps. Nitheesh George http://www.simpletools.co.in
How can I do that? That's how I currently control my forms. frmMain- Form: - Clicked event on a button creates object of an action class
clsUsage _clsUsage = new clsUsage(); _clsUsage.CalcUsage();
CalcUsage calls and closes the status formfrmStatus _frmStatus = new frmStatus(); _frmStatus.Show(); //doing some operations and modifying attributes to controls of frmStatus form _frmStatus.Close();
-
How can I do that? That's how I currently control my forms. frmMain- Form: - Clicked event on a button creates object of an action class
clsUsage _clsUsage = new clsUsage(); _clsUsage.CalcUsage();
CalcUsage calls and closes the status formfrmStatus _frmStatus = new frmStatus(); _frmStatus.Show(); //doing some operations and modifying attributes to controls of frmStatus form _frmStatus.Close();
Hi try the following. frmStatus _frmStatus = new frmStatus(); frmStatus.parent = this; frmStatus.showInTaskbar = false; _frmStatus.Show(); //doing some operations and modifying attributes to controls of frmStatus form _frmStatus.Close(); hope this helps Nitheesh George http://www.simpletools.co.in
-
Hi try the following. frmStatus _frmStatus = new frmStatus(); frmStatus.parent = this; frmStatus.showInTaskbar = false; _frmStatus.Show(); //doing some operations and modifying attributes to controls of frmStatus form _frmStatus.Close(); hope this helps Nitheesh George http://www.simpletools.co.in
Not so easy because the call of the form is in my action class. Tried the following.
//created a property in action class private Form parentForm; public Form ParentForm { get { return parentForm; } set { parentForm = value; } } //in frmMain in clicked event added _clsUsage.ParentForm = this; //in the action class in the action method _frmStatus.Parent = ParentForm;
But this creates an ArgumentException.