Hello,
i'm having a crazy time trying to get my child forms to be maximized.
i have: windows form as mdi parent - windowstate set to maximum.
on it is a radmenu.
i have a child windows form in which the windowstate is set to maximize.
i do the below code to load the child:
but when i run, the child is NOT maximized. when i maximize the mdi form (running by clicking the control max button on the mdi form), THEN the child form is maximized.
i did this with another menu - exactly the same only NOT using the radmenu and it works fine. is there something in the radmenu you need to set for this??
thanks for ANY help - i'm about to get rid of the telerik radmenu...if i cannot resolve. i have it set up as the "main menu=true"
i have the radmenu set up as:
i'm having a crazy time trying to get my child forms to be maximized.
i have: windows form as mdi parent - windowstate set to maximum.
on it is a radmenu.
i have a child windows form in which the windowstate is set to maximize.
i do the below code to load the child:
frmCPBase.MdiParent =
Me
frmCPBase.WindowState = FormWindowState.Maximized
gsResize(frmCPBase, frmCPBase.pnlMain)
frmCPBase.Show()
Public
Sub
gsResize(
ByVal
aoForm
As
Form,
ByVal
aoPnl
As
Panel)
Try
'* Center the MDI Child
If
aoForm.WindowState = 2
Then
'maximized
Dim
yInt
As
Integer
= Screen.PrimaryScreen.WorkingArea.Height / 2 - aoForm.Height / 2
aoForm.Location =
New
Point(Screen.PrimaryScreen.WorkingArea.Width / 2 - aoForm.Width / 2, 120)
If
aoForm.Location.X < 0
Then
aoForm.Location =
New
Point(0, aoForm.Location.Y)
End
If
If
aoForm.Location.Y < 0
Then
aoForm.Location =
New
Point(aoForm.Location.X, 0)
End
If
If
aoForm.Left < 0
Then
aoForm.Location =
New
Point(0, aoForm.Location.Y)
End
If
End
If
'* Center the frame
If
aoForm.WindowState = 2
Then
aoPnl.Location =
New
Point((aoForm.Width / 2) - (aoPnl.Width / 2), (aoForm.Height / 2) - (aoPnl.Height / 2))
Else
aoPnl.Location =
New
Point((aoForm.Width / 2) - (aoPnl.Width / 2), (aoForm.Height / 2) - (aoPnl.Height / 2))
End
If
Catch
ex
As
Exception
End
Try
End
Sub
but when i run, the child is NOT maximized. when i maximize the mdi form (running by clicking the control max button on the mdi form), THEN the child form is maximized.
i did this with another menu - exactly the same only NOT using the radmenu and it works fine. is there something in the radmenu you need to set for this??
thanks for ANY help - i'm about to get rid of the telerik radmenu...if i cannot resolve. i have it set up as the "main menu=true"
i have the radmenu set up as:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial
Class
frmMain
Inherits
System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected
Overrides
Sub
Dispose(
ByVal
disposing
As
Boolean
)
Try
If
disposing
AndAlso
components IsNot
Nothing
Then
components.Dispose()
End
If
Finally
MyBase
.Dispose(disposing)
End
Try
End
Sub
'Required by the Windows Form Designer
Private
components
As
System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private
Sub
InitializeComponent()
Me
.components =
New
System.ComponentModel.Container()
Me
.RadMenuItem4 =
New
Telerik.WinControls.UI.RadMenuItem()
Me
.RadMenuItem5 =
New
Telerik.WinControls.UI.RadMenuItem()
Me
.RadMenuItem3 =
New
Telerik.WinControls.UI.RadMenuItem()
Me
.RadMenuHeaderItem1 =
New
Telerik.WinControls.UI.RadMenuHeaderItem()
Me
.Timer1 =
New
System.Windows.Forms.Timer(
Me
.components)
Me
.cbMarkets =
New
Telerik.WinControls.UI.RadMenuComboItem()
Me
.RadMenuItem2 =
New
Telerik.WinControls.UI.RadMenuItem()
Me
.pnl2ndWithLogosAndMenu =
New
Telerik.WinControls.UI.RadPanel()
Me
.pnlRightInfo =
New
Telerik.WinControls.UI.RadPanel()
Me
.btnHelp =
New
Telerik.WinControls.UI.RadButton()
Me
.btnUser =
New
Telerik.WinControls.UI.RadButton()
Me
.lblDateandTime =
New
Telerik.WinControls.UI.RadLabel()
Me
.RadMenu1 =
New
Telerik.WinControls.UI.RadMenu()
Me
.RadMenuItem1 =
New
Telerik.WinControls.UI.RadMenuItem()
Me
.RadMenuItem6 =
New
Telerik.WinControls.UI.RadMenuItem()
Me
.pnlFirstBackground =
New
Telerik.WinControls.UI.RadPanel()
CType
(
Me
.pnl2ndWithLogosAndMenu, System.ComponentModel.ISupportInitialize).BeginInit()
Me
.pnl2ndWithLogosAndMenu.SuspendLayout()
CType
(
Me
.pnlRightInfo, System.ComponentModel.ISupportInitialize).BeginInit()
Me
.pnlRightInfo.SuspendLayout()
CType
(
Me
.btnHelp, System.ComponentModel.ISupportInitialize).BeginInit()
CType
(
Me
.btnUser, System.ComponentModel.ISupportInitialize).BeginInit()
CType
(
Me
.lblDateandTime, System.ComponentModel.ISupportInitialize).BeginInit()
CType
(
Me
.RadMenu1, System.ComponentModel.ISupportInitialize).BeginInit()
CType
(
Me
.pnlFirstBackground, System.ComponentModel.ISupportInitialize).BeginInit()
Me
.pnlFirstBackground.SuspendLayout()
Me
.SuspendLayout()
'
'RadMenuItem4
'
Me
.RadMenuItem4.AutoSize =
False
Me
.RadMenuItem4.Bounds =
New
System.Drawing.Rectangle(0, 0, 150, 24)
Me
.RadMenuItem4.
Class
=
""
Me
.RadMenuItem4.Name =
"RadMenuItem4"
Me
.RadMenuItem4.Text =
"Cycle Processing"
'
'RadMenuItem5
'
Me
.RadMenuItem5.AutoSize =
False
Me
.RadMenuItem5.Bounds =
New
System.Drawing.Rectangle(0, 0, 150, 24)
Me
.RadMenuItem5.
Class
=
""
Me
.RadMenuItem5.Name =
"RadMenuItem5"
Me
.RadMenuItem5.Padding =
New
System.Windows.Forms.Padding(0, 2, 0, 2)
Me
.RadMenuItem5.Text =
"Dunning"
'
'RadMenuItem3
'
Me
.RadMenuItem3.AutoSize =
False
Me
.RadMenuItem3.Bounds =
New
System.Drawing.Rectangle(0, 0, 150, 24)
Me
.RadMenuItem3.
Class
=
""
Me
.RadMenuItem3.Name =
"RadMenuItem3"
Me
.RadMenuItem3.Padding =
New
System.Windows.Forms.Padding(0, 2, 0, 2)
Me
.RadMenuItem3.Text =
"Carrier Provisioning"
'
'RadMenuHeaderItem1
'
Me
.RadMenuHeaderItem1.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.FitToAvailableSize
Me
.RadMenuHeaderItem1.
Class
=
""
Me
.RadMenuHeaderItem1.DisplayStyle = Telerik.WinControls.DisplayStyle.Text
Me
.RadMenuHeaderItem1.Name =
"RadMenuHeaderItem1"
Me
.RadMenuHeaderItem1.Padding =
New
System.Windows.Forms.Padding(5, 5, 0, 0)
Me
.RadMenuHeaderItem1.Text =
"Market"
'
'Timer1
'
'
'cbMarkets
'
Me
.cbMarkets.
Class
=
""
'
'
'
Me
.cbMarkets.ComboBoxElement.ArrowButtonMinWidth = 16
Me
.cbMarkets.ComboBoxElement.DefaultValue =
Nothing
Me
.cbMarkets.ComboBoxElement.EditorElement =
Me
.cbMarkets.ComboBoxElement
Me
.cbMarkets.ComboBoxElement.EditorManager =
Nothing
Me
.cbMarkets.ComboBoxElement.Focusable =
True
Me
.cbMarkets.ComboBoxElement.MaxValue =
Nothing
Me
.cbMarkets.ComboBoxElement.MinValue =
Nothing
Me
.cbMarkets.ComboBoxElement.NullTextColor = System.Drawing.SystemColors.GrayText
Me
.cbMarkets.ComboBoxElement.NullValue =
Nothing
Me
.cbMarkets.ComboBoxElement.OwnerOffset = 0
Me
.cbMarkets.ComboBoxElement.Value =
Nothing
Me
.cbMarkets.Name =
"cbMarkets"
Me
.cbMarkets.Text =
""
'
'RadMenuItem2
'
Me
.RadMenuItem2.AutoSize =
False
Me
.RadMenuItem2.Bounds =
New
System.Drawing.Rectangle(0, 0, 150, 24)
Me
.RadMenuItem2.
Class
=
""
Me
.RadMenuItem2.Name =
"RadMenuItem2"
Me
.RadMenuItem2.Padding =
New
System.Windows.Forms.Padding(0, 2, 0, 2)
Me
.RadMenuItem2.Text =
"Trans Processing"
'
'pnl2ndWithLogosAndMenu
'
Me
.pnl2ndWithLogosAndMenu.BackColor = System.Drawing.Color.Transparent
Me
.pnl2ndWithLogosAndMenu.BackgroundImage = Global.WindowsApplication1.My.Resources.Resources.ClientUtil_Heading
Me
.pnl2ndWithLogosAndMenu.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None
Me
.pnl2ndWithLogosAndMenu.Controls.Add(
Me
.pnlRightInfo)
Me
.pnl2ndWithLogosAndMenu.Controls.Add(
Me
.RadMenu1)
Me
.pnl2ndWithLogosAndMenu.Location =
New
System.Drawing.Point(0, 0)
Me
.pnl2ndWithLogosAndMenu.Name =
"pnl2ndWithLogosAndMenu"
Me
.pnl2ndWithLogosAndMenu.Size =
New
System.Drawing.Size(996, 114)
Me
.pnl2ndWithLogosAndMenu.TabIndex = 12
Me
.pnl2ndWithLogosAndMenu.ThemeName =
"Windows7"
'
'pnlRightInfo
'
Me
.pnlRightInfo.Controls.Add(
Me
.btnHelp)
Me
.pnlRightInfo.Controls.Add(
Me
.btnUser)
Me
.pnlRightInfo.Controls.Add(
Me
.lblDateandTime)
Me
.pnlRightInfo.Location =
New
System.Drawing.Point(577, 68)
Me
.pnlRightInfo.Name =
"pnlRightInfo"
Me
.pnlRightInfo.Size =
New
System.Drawing.Size(360, 18)
Me
.pnlRightInfo.TabIndex = 6
CType
(
Me
.pnlRightInfo.GetChildAt(0).GetChildAt(1), Telerik.WinControls.Primitives.BorderPrimitive).Visibility = Telerik.WinControls.ElementVisibility.Hidden
'
'btnHelp
'
Me
.btnHelp.Location =
New
System.Drawing.Point(300, 0)
Me
.btnHelp.Name =
"btnHelp"
'
'
'
Me
.btnHelp.RootElement.ToolTipText =
"Click for HELP"
Me
.btnHelp.Size =
New
System.Drawing.Size(48, 18)
Me
.btnHelp.TabIndex = 7
Me
.btnHelp.Text =
"HELP"
'
'btnUser
'
Me
.btnUser.Location =
New
System.Drawing.Point(250, 0)
Me
.btnUser.Name =
"btnUser"
'
'
'
Me
.btnUser.RootElement.ToolTipText =
"Click to LOG OUT"
Me
.btnUser.Size =
New
System.Drawing.Size(48, 18)
Me
.btnUser.TabIndex = 6
Me
.btnUser.Text =
"UserName"
'
'lblDateandTime
'
Me
.lblDateandTime.AutoSize =
False
Me
.lblDateandTime.ForeColor = System.Drawing.Color.White
Me
.lblDateandTime.Location =
New
System.Drawing.Point(3, 1)
Me
.lblDateandTime.Name =
"lblDateandTime"
'
'
'
Me
.lblDateandTime.RootElement.ForeColor = System.Drawing.Color.White
Me
.lblDateandTime.Size =
New
System.Drawing.Size(234, 16)
Me
.lblDateandTime.TabIndex = 3
Me
.lblDateandTime.Text =
"Date and Time here"
Me
.lblDateandTime.TextAlignment = System.Drawing.ContentAlignment.MiddleRight
'
'RadMenu1
'
Me
.RadMenu1.Dock = System.Windows.Forms.DockStyle.Bottom
Me
.RadMenu1.Items.AddRange(
New
Telerik.WinControls.RadItem() {
Me
.RadMenuItem1,
Me
.RadMenuItem2,
Me
.RadMenuItem3,
Me
.RadMenuItem4,
Me
.RadMenuItem5,
Me
.RadMenuItem6,
Me
.RadMenuHeaderItem1,
Me
.cbMarkets})
Me
.RadMenu1.Location =
New
System.Drawing.Point(0, 64)
Me
.RadMenu1.Name =
"RadMenu1"
Me
.RadMenu1.Size =
New
System.Drawing.Size(996, 50)
Me
.RadMenu1.TabIndex = 0
Me
.RadMenu1.Text =
"RadMenu1"
Me
.RadMenu1.ThemeName =
"Windows7"
'
'RadMenuItem1
'
Me
.RadMenuItem1.AutoSize =
False
Me
.RadMenuItem1.Bounds =
New
System.Drawing.Rectangle(0, 0, 150, 24)
Me
.RadMenuItem1.
Class
=
""
Me
.RadMenuItem1.Name =
"RadMenuItem1"
Me
.RadMenuItem1.Padding =
New
System.Windows.Forms.Padding(4, 2, 0, 2)
Me
.RadMenuItem1.Text =
"System Profiles"
'
'RadMenuItem6
'
Me
.RadMenuItem6.AutoSize =
False
Me
.RadMenuItem6.Bounds =
New
System.Drawing.Rectangle(0, 0, 100, 24)
Me
.RadMenuItem6.
Class
=
""
Me
.RadMenuItem6.MdiList =
True
Me
.RadMenuItem6.Name =
"RadMenuItem6"
Me
.RadMenuItem6.Text =
"Forms"
'
'pnlFirstBackground
'
Me
.pnlFirstBackground.BackgroundImage = Global.WindowsApplication1.My.Resources.Resources.PageHeading_Topstrip2
Me
.pnlFirstBackground.Controls.Add(
Me
.pnl2ndWithLogosAndMenu)
Me
.pnlFirstBackground.Location =
New
System.Drawing.Point(0, 0)
Me
.pnlFirstBackground.Name =
"pnlFirstBackground"
Me
.pnlFirstBackground.Size =
New
System.Drawing.Size(999, 114)
Me
.pnlFirstBackground.TabIndex = 15
Me
.pnlFirstBackground.Text =
"RadPanel2"
Me
.pnlFirstBackground.ThemeName =
"Windows7"
'
'frmMain
'
Me
.AutoScaleDimensions =
New
System.Drawing.SizeF(6.0!, 13.0!)
Me
.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me
.ClientSize =
New
System.Drawing.Size(892, 526)
Me
.Controls.Add(
Me
.pnlFirstBackground)
Me
.IsMdiContainer =
True
Me
.Name =
"frmMain"
Me
.Text =
"Client Utility Center"
Me
.WindowState = System.Windows.Forms.FormWindowState.Maximized
CType
(
Me
.pnl2ndWithLogosAndMenu, System.ComponentModel.ISupportInitialize).EndInit()
Me
.pnl2ndWithLogosAndMenu.ResumeLayout(
False
)
Me
.pnl2ndWithLogosAndMenu.PerformLayout()
CType
(
Me
.pnlRightInfo, System.ComponentModel.ISupportInitialize).EndInit()
Me
.pnlRightInfo.ResumeLayout(
False
)
CType
(
Me
.btnHelp, System.ComponentModel.ISupportInitialize).EndInit()
CType
(
Me
.btnUser, System.ComponentModel.ISupportInitialize).EndInit()
CType
(
Me
.lblDateandTime, System.ComponentModel.ISupportInitialize).EndInit()
CType
(
Me
.RadMenu1, System.ComponentModel.ISupportInitialize).EndInit()
CType
(
Me
.pnlFirstBackground, System.ComponentModel.ISupportInitialize).EndInit()
Me
.pnlFirstBackground.ResumeLayout(
False
)
Me
.ResumeLayout(
False
)
End
Sub
Friend
WithEvents
RadMenuItem4
As
Telerik.WinControls.UI.RadMenuItem
Friend
WithEvents
RadMenuItem5
As
Telerik.WinControls.UI.RadMenuItem
Friend
WithEvents
RadMenuItem3
As
Telerik.WinControls.UI.RadMenuItem
Friend
WithEvents
RadMenuHeaderItem1
As
Telerik.WinControls.UI.RadMenuHeaderItem
Friend
WithEvents
Timer1
As
System.Windows.Forms.Timer
Friend
WithEvents
cbMarkets
As
Telerik.WinControls.UI.RadMenuComboItem
Friend
WithEvents
RadMenuItem2
As
Telerik.WinControls.UI.RadMenuItem
Friend
WithEvents
pnl2ndWithLogosAndMenu
As
Telerik.WinControls.UI.RadPanel
Friend
WithEvents
pnlRightInfo
As
Telerik.WinControls.UI.RadPanel
Friend
WithEvents
btnHelp
As
Telerik.WinControls.UI.RadButton
Friend
WithEvents
btnUser
As
Telerik.WinControls.UI.RadButton
Friend
WithEvents
lblDateandTime
As
Telerik.WinControls.UI.RadLabel
Friend
WithEvents
RadMenu1
As
Telerik.WinControls.UI.RadMenu
Friend
WithEvents
RadMenuItem1
As
Telerik.WinControls.UI.RadMenuItem
Friend
WithEvents
RadMenuItem6
As
Telerik.WinControls.UI.RadMenuItem
Friend
WithEvents
pnlFirstBackground
As
Telerik.WinControls.UI.RadPanel
End
Class