MAXIMIZAR O FORM

SANDROMOUZINHO 24/07/2012 12:57:15
#406514
como faço para que o Form que está dentro do MDIFrom, apareça Maximizado?

Obrigado galera, um abraço.
PEGUDO 24/07/2012 14:03:43
#406519
Configure a propriedade WindowState para Maximized
NILSONTRES 24/07/2012 14:21:02
#406521
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()
PROGRAMADORVB6 25/07/2012 14:08:09
#406575
Veja se este exemplo serve :



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é +
KURTGU 25/07/2012 15:39:47
#406577
MDIFORM.DOCK=DOCK.FILL
Tópico encerrado , respostas não são mais permitidas