Article ID: 173638
Article Last Modified on 12/10/2003
ControlBox = True
MinButton = False and/or MaxButton = False
BorderStyle = 1 - Fixed Single or BorderStyle = 2 - Sizable
Or
BorderStyle = 3 - Fixed Dialog
However, the What's This? button fails to appear in the title bar of an MDI
child form even when the conditions above are met.
MaxButton = False
MinButton = False
WhatsThisButton = True
WhatsThisHelp = True
Private Declare Function SetParent Lib "user32" _
(ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) _
As Long
Const WS_CHILDWINDOW = &H40000000
Const GWL_STYLE = (-16)
Private Sub Form_Load()
Dim x As Long
Dim y As Long
'Set Form1 as the parent of form2
x = SetParent(Form2.hwnd, Form1.hwnd)
Form2.Show
x = GetWindowLong(Form2.hwnd, GWL_STYLE)
y = x + WS_CHILDWINDOW
x = SetWindowLong(Form2.hwnd, GWL_STYLE, y)
End Sub
MaxButton = False
MDIChild = True
MinButton = False
WhatsThisButton = True
WhatsThisHelp = True
Additional query words: vb5
Keywords: kbbug KB173638