Has any one have idea how to disable the middle button of three that are in the form?
I want only this button to disable. Not the close button and not the minimize button.
Optikal 04-08-2003, 11:50 PM set the forms MaxButton property to false.
VolodyAnarchist 04-08-2003, 11:51 PM I don't think that you can turn off the restore button; what you might try to do is to manually set the form size to be the whole screen, then turn off sizable and maxbutton for the form.
The problem with that would be that user could move the window, and i don't think that you'd want that.
Free your mind and seek the truth.
VolodyA! V Anarhist
wengwashere 04-08-2003, 11:58 PM Has any one have idea how to disable the middle button of three that are in the form?
I want only this button to disable. Not the close button and not the minimize button.
set MaxButton to FALSE
Why to manually set the form size to be the whole screen?
Can't I just turn off maxbutton for the form?
I don't think that you can turn off the restore button; what you might try to do is to manually set the form size to be the whole screen, then turn off sizable and maxbutton for the form.
The problem with that would be that user could move the window, and i don't think that you'd want that.
Free your mind and seek the truth.
VolodyA! V Anarhist
The Minimize button will still be enabled. Right?
I just want the minimize and close button enabled.
Has any one have idea how to disable the middle button of three that are in the form?
I want only this button to disable. Not the close button and not the minimize button.
set MaxButton to FALSE
VolodyAnarchist 04-09-2003, 02:13 AM Why to manually set the form size to be the whole screen?
Can't I just turn off maxbutton for the form?
I might be wrong, but that would not allow the form to be maximized when the prog is ran. But i think what is needed here is for the restore button to be turned off. And i don't think that you can just max the form in vb and expect that to be the norm when the prog is ran.
Free your mind and seek the truth.
VolodyA! V Anarhist
It seems that the MaxButton did disabled the restore down button.
The problem is that the user can change the size of the form and I want to prevent him to do that.
HiTmAN 04-09-2003, 09:38 AM change the forms BorderStyle property to 1 - Fixed Single
Why so difficult, just adjust the size of your program, as big as you like,
and set the BorderStyle property to 4,
now you can't change it anymore.
Remo, The Netherlands
But the minimize button won't be there.
I want only two buttons to be. the close and minimize.
I also want that the user won't be able to change the form size.
Is that some thing VB can do?
change the forms BorderStyle property to 1 - Fixed Single
HiTmAN 04-09-2003, 09:48 AM Set the BorderStyle property to 1 - Fixed Single, but then make a button to minimize the form somewhere on your form :)
Private Sub Command1_Click()
Form1.WindowState = 1
End Sub
(Or, you could set the forms BorderStyle property to 0 - None and make a custom titlebar ;) )
Set MaxButton to false and minibutton to true.
garysenter 02-02-2004, 09:23 AM what is the number for restore? or how else can i trigger restore from VB code?
Bennee 02-02-2004, 10:10 AM Alternatively, you can use API's to do the same thing.
Const WS_THICKFRAME = &H40000
Const WS_MAXIMIZEBOX = &H10000
Const GWL_STYLE = (-16)
'API Declarations
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
Private Sub Form_Load()
Dim lngCurStyle As Long
Dim lngNewStyle As Long
'Set style to non-resizable
lngCurStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
lngNewStyle = lngCurStyle And Not (WS_THICKFRAME)
lngNewStyle = lngNewStyle And Not (WS_MAXIMIZEBOX)
Call SetWindowLong(Me.hwnd, GWL_STYLE, lngNewStyle)
End Sub
HiTmAN 02-02-2004, 10:35 AM Me.WindowState = vbNormal
|