mdi client with out 3D boarder?

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

Is there any easy way to remove the 3D boarder around the MDI client area?
 
Brian Henry said:
Is there any easy way to remove the 3D boarder around the MDI client area?

Modify the Designer Generated code to add a reference to the MDIClient
control:

\\\
Private WithEvents MDI As MDIClient
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.MDI = New MDIClient
...
Me.Controls.Add(Me.MDI)
...
End Sub
///

Then add a call to setwindowlong in the forms Layout method. (if you put it
in the Load method then where the 3d border was will not be redrawn when the
form is shown).

\\\
Private Sub Form_Layout(ByVal sender As Object, ByVal e As LayoutEventArgs)
Handles MyBase.Layout
SetWindowLong(MDI.Handle, GWL_EXSTYLE, IntPtr.Zero)
End Sub
///

These are the necessary declarations:

\\\
<System.Runtime.InteropServices.DllImport("user32")> _
Private Shared Function SetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As
Int32, _
ByVal dwNewLong As IntPtr) As IntPtr
End Function

Private Const GWL_EXSTYLE As Int32 = (-20)
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top