| | |
Activate form2 when form1 activates(Back to front)
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2008
Posts: 66
Reputation:
Solved Threads: 0
I have mentioned so many times, minimize and maximize is not a aproblem for me.
I already wrote this code for minimize and maximize of both forms and working fine, but the problem is as follows.
Form1 and form2 both in normal mode.
if i click on 3rd window, both form1 and form2 will go behind that 3rd window.
Again if i want to see form1 and form2, i have to click on form1, so that both forms have to come front of third window and have to visible of both form1 and form2.
I hope u understood my question.
I already wrote this code for minimize and maximize of both forms and working fine, but the problem is as follows.
Form1 and form2 both in normal mode.
if i click on 3rd window, both form1 and form2 will go behind that 3rd window.
Again if i want to see form1 and form2, i have to click on form1, so that both forms have to come front of third window and have to visible of both form1 and form2.
I hope u understood my question.
Ambarish
Dude this works
Hope that helps
C# Syntax (Toggle Plain Text)
private void Form1_Activated(object sender, EventArgs e) { Form2 F2 = new Form2(); F2.ShowDialog(); // Puts it on top (form1 wont be accessible) F2.Show(); // Makes form 1 accessible }
Hope that helps
Last edited by cVz; Jan 19th, 2009 at 5:47 am.
Delphi & C# programmer deluxe...
i had that same problem and that made me very crazy when i select any window and select my form the another form kept back to that window but i sort that out 
here is the code, mark this thread Solved

here is the code, mark this thread Solved
C# Syntax (Toggle Plain Text)
bool IsJustActivated = false; private void Xform_Activated(object sender, EventArgs e) { if (!IsJustActivated) { IsJustActivated = true; BackForm.Activate(); bool tmp_holdValue = this.TopMost; this.TopMost = true; this.TopMost = tmp_holdValue; //this.Activate() wont work } else IsJustActivated = false; }
Last edited by xmen_xwk; Jan 25th, 2009 at 12:54 am.
![]() |
Other Threads in the C# Forum
- Previous Thread: time complexity
- Next Thread: can C# perform command prompt lines
Views: 3206 | Replies: 16
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# chat check checkbox class client combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms ftp function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking operator oracle path photoshop picturebox pixelinversion prime programming radians regex remote remoting resource richtextbox save saving serialization server socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





