MAXIMIZAR O FORM
como faço para que o Form que está dentro do MDIFrom, apareça Maximizado?
Obrigado galera, um abraço.
Obrigado galera, um abraço.
Configure a propriedade WindowState para Maximized
Se você chamar ele como MDI, ele ira abrir sempre dentro do MDI.
FRM.MdiParent = Me
FRM.Show()
Caso contrario, é só alterar a propriedade, conforme indicou o amigo PEGUDO.
E depois,
FRM.Show()
FRM.MdiParent = Me
FRM.Show()
Caso contrario, é só alterar a propriedade, conforme indicou o amigo PEGUDO.
E depois,
FRM.Show()
Veja se este exemplo serve :
Form1.vb
FormChild.vb
Até +
Form1.vb
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Text = [Ô]MDIChildForm Demo - Created by AceInfinity[Ô]
Me.IsMdiContainer = True
For Each ctlMDI In Me.Controls
Try
ctlMDI = CType(ctlMDI, MdiClient)
ctlMDI.BackColor = Color.FromArgb(255, 200, 200, 200)
Catch ex As InvalidCastException
End Try
Next
End Sub
Public ChildCount As Double = 1
Public ChildLabel As String = Nothing
Private Sub AddNewMDIChild()
Dim ChildFrm As New FormChild
ChildFrm.MdiParent = Me
ChildLabel = [Ô]Child[Ô] & ChildCount
With ChildFrm
.Name = ChildLabel
.Text = ChildLabel
[ô].WindowState = FormWindowState.Maximized
.MinimizeBox = False
.BackColor = Color.FromArgb(255, 230, 230, 230)
.Show()
End With
MenuStrip1.Items.Add(ChildFrm.Name)
ChildCount += 1
End Sub
Private Sub MenuStrip1_Click(ByVal sender As Object, ByVal e As ToolStripItemClickedEventArgs) Handles MenuStrip1.ItemClicked
Dim s As String = e.ClickedItem.Text
Console.WriteLine(s)
For Each f As Form In Me.MdiChildren
If f.Name = s Then
f.Focus()
Exit For
End If
Next
If s = [Ô]AddNew[Ô] Then
AddNewMDIChild()
End If
End Sub
End Class
FormChild.vb
Public Class FormChild
Private Sub FormChild_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Icon = My.Resources.star_black
End Sub
Private FormList As New List(Of String)
Private ActiveForm As String = Nothing
Private Sub FormChild_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
ActiveForm = Me.Text
For Each f As Form In Form1.MdiChildren
FormList.Add(f.Name)
Next
Form1.MenuStrip1.Items.Clear()
Form1.MenuStrip1.Items.Add([Ô]AddNew[Ô])
FormList.Remove(ActiveForm)
For Each ObjMenuItm As String In FormList
Form1.MenuStrip1.Items.Add(ObjMenuItm)
Next
FormList.Clear()
End Sub
End Class
Até +
MDIFORM.DOCK=DOCK.FILL
Tópico encerrado , respostas não são mais permitidas