INTELLIGENT WORK FORUMS FOR COMPUTER PROFESSIONALS
Come Join Us!
- Talk With Other Members
- Be Notified Of Responses
To Your Posts
- Keyword Search
- Turn Off Ad Banners
- One-Click Access To Your
Favorite Forums
- Automated Signatures
On Your Posts
- Best Of All, It's Free!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.
Partner With Us!
"Best Of Breed" Forums Add Stickiness To Your Site

(Download This Button Today!)
Member Feedback
"...Keep up the good work - excellent site - i'd been looking for something like this for ages !..."
Geography
Where in the world do Tek-Tips members come from?
|
Visual Basic(Microsoft) -VB.NET 2002-2008 FAQ
|
How-to
|
"Maximized" MDI Child without Controlboxes VB 2005
Posted: 19 Jan 06
|
Our company needed an MDI form where the children were always maximized and would not let the user minimize or restore the children forms. Also needed to be able to navigate between the child forms.
Setting the children's Controlbox, MinBox and MaxBox to false also setting the windowstate = Maximize and FormBorderStyle = None didn't work. The parent still contained the control boxes to minimize, restore or close the child form.
After trying several variations, we came up with the following solution which worked exactly the way we needed it to. Simply create a project with three forms setup as specified below. It should look similar to this:

Setup: Form1 Properties: IsMdiContainer = True
Listbox1 docked to left of Form1. ImageList1 contains one image.
Form2 and Form3 Properties: WindowState = Normal
Form2 has a label with Label1.Text = "2"
Form3 has a label with Label1.Text = "3"
CODE:
CODEPublic Class Form1 Dim frm2 As New Form2 Dim frm3 As New Form3
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load frm2.MdiParent = Me frm2.Dock = DockStyle.Fill Me.ListView1.Items.Add(frm2.Text, 0) frm2.Show() frm3.MdiParent = Me frm3.Dock = DockStyle.Fill Me.ListView1.Items.Add(frm3.Text, 0) frm3.Show() End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged Dim lv As ListView = CType(sender, ListView)
Select Case lv.FocusedItem.Text Case frm2.Text frm3.Hide() frm2.Show() Case Else frm2.Hide() frm3.Show()
End Select End Sub End Class |
Back to Visual Basic(Microsoft) -VB.NET 2002-2008 FAQ Index
Back to Visual Basic(Microsoft) -VB.NET 2002-2008 Forum
My FAQ Archive
Email This FAQ To A Friend |
|
 |
|