Tuesday, July 28, 2009

In c#.net or VB.net, how do I create a window that contains windows?

Many programs have a master window and there are sub-windows like in photoshop. Using the 'Window' menu a user can switch between the two or more sub-windows. Do I start with a form as is given when a new project is created(with visual studio) and add them (if so, how?) or do I create seperate forms and call one from the other(if so, how?) I am looking for an overview of how it works. A book that shows this would be great!

In c#.net or VB.net, how do I create a window that contains windows?
I think you mean to use MDI, the Multiple-Document Interface. The link below will lead to C# and VB examples.
Reply:assumption :


frmStart : The first form which loads when the program is executed.


frmSearch : A form for searching like find/replace.


menuSearch : A menu item in frmstart which when clicked opens the frmsearch.





the code is as follows:





private sub OpenSearch ByVal sender As System.Object, ByVal e As System.EventArgs) Handles menuSearch.Click


Dim frmSearchChld As New frmSearch()


With frmSearchChld


.Owner = Me


.Show() // .showDialog()


End With


end sub


No comments:

Post a Comment