switching between forms
-
hi, iam currently working on a winform application using Visual C#,i would like my application to be able to switch between two open forms and work on one without minimizing the other. eg explore My Computer, while the window is still open explore Desktop (another window opens ) note you can switch between the two windows without minimizing one is u can refer me to any articles or code examples that work that way please refer me i hope you understand my question thanks :-D regards paula
-
hi, iam currently working on a winform application using Visual C#,i would like my application to be able to switch between two open forms and work on one without minimizing the other. eg explore My Computer, while the window is still open explore Desktop (another window opens ) note you can switch between the two windows without minimizing one is u can refer me to any articles or code examples that work that way please refer me i hope you understand my question thanks :-D regards paula
I may be missing something but... Add a second form to your application, assume it is Form2. In some event on Form1 (button click whatever), put the following code Form2 frm2 = new Form2(); frm2.Show(); Both forms should be open and available. All you have to do is make sure that neither of them is maximized. You can even limit the size with the MaximumSize property so neither of them takes the whole area. HTH Gandalf
-
hi, iam currently working on a winform application using Visual C#,i would like my application to be able to switch between two open forms and work on one without minimizing the other. eg explore My Computer, while the window is still open explore Desktop (another window opens ) note you can switch between the two windows without minimizing one is u can refer me to any articles or code examples that work that way please refer me i hope you understand my question thanks :-D regards paula
If you have created 2 forms in the same project all tou have to do is to open them with the Show method. Form1 f = new Form1(); f.Show(); Make sure that both of the forms are visible in the System Taskbar(ShowInTaskbar Property). If you want ony one form at a time use the ShowDialog() method
-
hi, iam currently working on a winform application using Visual C#,i would like my application to be able to switch between two open forms and work on one without minimizing the other. eg explore My Computer, while the window is still open explore Desktop (another window opens ) note you can switch between the two windows without minimizing one is u can refer me to any articles or code examples that work that way please refer me i hope you understand my question thanks :-D regards paula
First, I'm trying to clarify your requirements. Correct me if that is not what you want. You want your application to have some virtual desktop feature so that when you switch to next window, you don't see any other windows, but you cannot minimize, hide or disable those unseen windows. My solution is using virtual screen. Lets say your monitor has a resolution of 1280x1024. Your virtual screen will be 2560x1024.
-----------------------------------
| | |
| | |
| Monitor | Unused |
| | |
| | |
| | |First, position all your windows in the UNUSED area. You can do so by changing the size/location property. Then, whatever window you want to switch to, just reposition that window to the MONITOR area. The key point is that whenever you open a window or draw anything in the UNUSED area, you will not see it, but your rendering logic remains functioning. You may implement this directly to the screen, or in the memory (double buffering). Hope this helps. - It's easier to make than to correct a mistake.
-
If you have created 2 forms in the same project all tou have to do is to open them with the Show method. Form1 f = new Form1(); f.Show(); Make sure that both of the forms are visible in the System Taskbar(ShowInTaskbar Property). If you want ony one form at a time use the ShowDialog() method
thanks for replying actualy that is not what im looking for lets say i have two forms ,form2 and form2 and a in my form2 i have button and in the button click event i have the code Form2 f = new Form2(); f.Show(); my form2 shows i want to switch between these two forms currently i can only work with form2 bcause its active i want both of them to be active so if i want to change something in form1 i should be able to. thanks:) regards paula
-
I may be missing something but... Add a second form to your application, assume it is Form2. In some event on Form1 (button click whatever), put the following code Form2 frm2 = new Form2(); frm2.Show(); Both forms should be open and available. All you have to do is make sure that neither of them is maximized. You can even limit the size with the MaximumSize property so neither of them takes the whole area. HTH Gandalf
thanks for replying actualy that is not what im looking for lets say i have two forms ,form2 and form2 and a in my form2 i have button and in the button click event i have the code Form2 f = new Form2(); f.Show(); my form2 shows i want to switch between these two forms currently i can only work with form2 bcause its active i want both of them to be active so if i want to change something in form1 i should be able to. regards paula