Hi,
Is it possible to set the Controlbox property for a form to False, but still have the [x] button in the caption bar?
Because if I set the Controlbox = False, then the X button also disappears....
Thankx,
CJ
Printable View
Hi,
Is it possible to set the Controlbox property for a form to False, but still have the [x] button in the caption bar?
Because if I set the Controlbox = False, then the X button also disappears....
Thankx,
CJ
If the ControlBox is set to False, all of the caption bar buttons will be removed.
you can set the borderstyle to Fixed/Sizable ToolWindow, but the font on the titlebar also changes.
Set the form border to Fixed Dialog, and then delete the icon. You will have to refresh the form in the IDE to see the changes made by removing the icon though...D'oh!
Or did you want the form to be sizeable???
Woka
...or you could just set the border style to Sizable tool window...
woka
What I want is something like this:
Like this you mean....
:D
But what did the trick?
All you have to do is goto the Icon, you'll see it says (Icon), highlight the text, press Delete.
Run the form, Viola!
...oh, and add WhatsThisHelp button = trueQuote:
Originally posted by Wokawidget
Set the form border to Fixed Dialog, and then delete the icon. You will have to refresh the form in the IDE to see the changes made by removing the icon though...D'oh!
Or did you want the form to be sizeable???
Woka
Set the WhatsThisButton to True and MaxButton and MinButton to False.
if you have a fixed dialog form, then you don't have the Max and Min buttons, so no need to set them to false :DQuote:
Originally posted by arnabbandyo
Set the WhatsThisButton to True and MaxButton and MinButton to False.
If you just set them to False in a normal form, then you are still stuck with the icon :(
Woka
Yaaaaah, you are right.
Thanks very much guys!!!!!
I have a form with the borderstyle set to 2 sizableQuote:
Originally posted by Wokawidget
if you have a fixed dialog form, then you don't have the Max and Min buttons, so no need to set them to false :D
If you just set them to False in a normal form, then you are still stuck with the icon :(
Woka
the WhatsThisButton to True and MaxButton and MinButton to False
And they don't show up ?
Am I missing something here ?
:confused:
To remove the icon from a form try:
VB Code:
Option Explicit 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 Const GWL_EXSTYLE = (-20) Private Const WS_EX_DLGMODALFRAME = &H1& Private Sub Form_Load() Dim lexstyle As Long lexstyle = GetWindowLong(Me.hwnd, GWL_EXSTYLE) lexstyle = lexstyle Or WS_EX_DLGMODALFRAME Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, lexstyle) End Sub
Hope this helps,
Duncan
See - many of my posts make no mention of the EventVB.dll .... doh!
But in that case the icon of the form will appear at the left-top corner, which he wants to avoid too. Please look at the figure attached before.
Oh yeah - additionally you must go to the form properties (at design time), select Icon and press delete so it says (None).
Then it works..