Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2004

Tip: Looking for answers? Try searching our database.

how to: bring main form to front, when its modeless dialog comes into focus?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Assaf - 01 Feb 2004 04:46 GMT
hi all

i have a main form and it displays a modelss dialog.
when the user brings the dialog into focus,
the main form is left in the back.

how can i bring the main form into the front,
when its modeless dialog is selected into focus?

my code:

class MyMainForm
{
   MyModelessDalog     _MyModelessDalog = new MyModelessDalog();

   MyMainForm()
   {
       this._MyModelessDalog.Owner = this;
   }

   void ShowDialog()
   {
       this._MyModelessDalog.Show();
   }
}

class MyModelessDalog
{

}

Assaf
DalePres - 01 Feb 2004 15:44 GMT
Do it this way (I am changing the form names for simplicity)

public class Form1()
{
.
.
Form2 form2 = new Form2();
this.AddOwnedForms(form2);
form2.Show();
.
.
}

Dale

> hi all
>
[quoted text clipped - 4 lines]
> how can i bring the main form into the front,
> when its modeless dialog is selected into focus?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.