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 / July 2004

Tip: Looking for answers? Try searching our database.

midi form can open 1

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joe - 28 Jul 2004 09:53 GMT
Dear all
i have a parent form and have some menuitem to load midi form. how can i  only allow use can only load ONE midi form of the same item
LEBRUN Thomas - 28 Jul 2004 10:26 GMT
Hello

Hum.. for your problem, i think you could disable the menuitem when the MDI form is loaded (so when user have clicked on the menuitem). Like this, user won't be able to click on the menuitem and so, won't be able to open more than 1 MDI form.

Signature

LEBRUN Thomas
http://morpheus.developpez.com

> Dear all
> i have a parent form and have some menuitem to load midi form. how can i  only allow use can only load ONE midi form of the same item
John J. Hughes II - 28 Jul 2004 16:53 GMT
I use the following function.  You call the function with the name of the
form.  If the form is open then show the form if the form is not open create
a new form.

private void menuDataQuery_Click(object sender, System.EventArgs e)
{
if(!this.CheckFormOpen("frmDataQuery"))
{
 frmDataQuery frm = new frmDataQuery();
 frm.MdiParent = this;
 frm.Show();
}
}

private bool CheckFormOpen(string name)
{
foreach(System.Windows.Forms.Form frm in this.MdiChildren)
{
 if(frm.Name == name)
 {
  frm.BringToFront();
  return true;
 }
}
return false;
}

Regards,
John
Supra - 29 Jul 2004 14:31 GMT
coding by car

Private Sub mnuFrmHandling(ByVal frmName As String)
       For Each frm As Form In Me.MdiChildren
           If frm.Name = frmName Then
               frm.BringToFront()
               Exit Sub
           End If
       Next
       Dim frmNew As Form
       Select Case frmName
           Case "Persons"
               frmNew = New frmPersons
           Case "Actions"
               frmNew = New frmActions
           Case Else
               frmNew = New frmTabellen(frmName)
       End Select
       frmNew.MdiParent = Me
       frmNew.Show()
       frmNew.WindowState = FormWindowState.Maximized
       frmNew.Name = frmName
       frmNew.BringToFront()
End Sub

regards

>Dear all
>i have a parent form and have some menuitem to load midi form. how can i  only allow use can only load ONE midi form of the same item

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.