Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MDI Forms: Removing the ability to resize the MDI Form

Status
Not open for further replies.

Hexum

Programmer
Jul 3, 2002
3
US
Anyone have any Idea how to remove the sizing ability from an MDI form?
 
Thanks for your response but MDI forms do not have the BorderStyle Property. I did however find a way to do it using the SetWindowLong Windows API Function

For future reference it goes like this:

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Private Const GWL_STYLE = -16
Private Const WS_NOSIZEMINIMIZE = 113901568

Private Sub MDIForm1_Load()

SetWindowLong Me.hwnd, GWL_STYLE, WS_NOSIZEMINIMIZE

End Sub

Note: Then WS_NOSIZEMINIMIZE is not an atual windows API constant. I created it. None of the constatns that I found did what I wanted to do. So I set up a normal form the way that I wanted the MDI form to work and used the GetWindowLong function and that returned me the number 113901568, which makes the MDI form operate in the same way as my test form.

Tnx again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top