J
Jacob
I'm trying to create an MDI form where the MDI area dosn't have the
traditional 3D borders. I thought at one point the code I had in the form
constructor was working, but now I'm getting an MDI without borders, but the
main menu on my form no longer appears. Anybody who has a little more
experience with this and is willing to help, I would appreciate it.
Thanks,
Jacob
// In MDI form constructor, after InitializeComponent.
for(int i = 0; i < this.Controls.Count; i++)
{
mdiClient = Controls as System.Windows.Forms.MdiClient;
if(mdiClient != null)
{
// Get Styles using Win32 calls
int style = Win32.GetWindowLong(mdiClient.Handle, Win32.GWL_STYLE);
int exStyle = Win32.GetWindowLong(mdiClient.Handle, Win32.GWL_EXSTYLE);
// Remove any borders on the Mdi.
style &= ~Win32.WS_BORDER;
exStyle &= ~Win32.WS_EX_CLIENTEDGE;
// Set Styles using Win32 calls
Win32.SetWindowLong(mdiClient.Handle, Win32.GWL_STYLE, style);
Win32.SetWindowLong(mdiClient.Handle, Win32.GWL_EXSTYLE, exStyle);
break;
}
}
traditional 3D borders. I thought at one point the code I had in the form
constructor was working, but now I'm getting an MDI without borders, but the
main menu on my form no longer appears. Anybody who has a little more
experience with this and is willing to help, I would appreciate it.
Thanks,
Jacob
// In MDI form constructor, after InitializeComponent.
for(int i = 0; i < this.Controls.Count; i++)
{
mdiClient = Controls as System.Windows.Forms.MdiClient;
if(mdiClient != null)
{
// Get Styles using Win32 calls
int style = Win32.GetWindowLong(mdiClient.Handle, Win32.GWL_STYLE);
int exStyle = Win32.GetWindowLong(mdiClient.Handle, Win32.GWL_EXSTYLE);
// Remove any borders on the Mdi.
style &= ~Win32.WS_BORDER;
exStyle &= ~Win32.WS_EX_CLIENTEDGE;
// Set Styles using Win32 calls
Win32.SetWindowLong(mdiClient.Handle, Win32.GWL_STYLE, style);
Win32.SetWindowLong(mdiClient.Handle, Win32.GWL_EXSTYLE, exStyle);
break;
}
}