Results 1 to 19 of 19

Thread: No icon but [x] button

  1. #1

    Thread Starter
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180

    No icon but [x] button

    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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    If the ControlBox is set to False, all of the caption bar buttons will be removed.

  3. #3
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    you can set the borderstyle to Fixed/Sizable ToolWindow, but the font on the titlebar also changes.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  4. #4
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    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

  5. #5

  6. #6

    Thread Starter
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    What I want is something like this:
    Attached Images Attached Images  

  7. #7

  8. #8

    Thread Starter
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180

    Thumbs up Exactly. Thanks Woka!

    But what did the trick?

  9. #9
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    All you have to do is goto the Icon, you'll see it says (Icon), highlight the text, press Delete.

    Run the form, Viola!

  10. #10
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    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
    ...oh, and add WhatsThisHelp button = true

  11. #11
    Addicted Member
    Join Date
    Sep 2002
    Location
    Guwahati, Assam, India
    Posts
    131

    Smile

    Set the WhatsThisButton to True and MaxButton and MinButton to False.
    I am new to VB...

  12. #12
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    Originally posted by arnabbandyo
    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
    If you just set them to False in a normal form, then you are still stuck with the icon

    Woka

  13. #13
    Addicted Member
    Join Date
    Sep 2002
    Location
    Guwahati, Assam, India
    Posts
    131

    Cool

    Yaaaaah, you are right.
    I am new to VB...

  14. #14

    Thread Starter
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    Thanks very much guys!!!!!

  15. #15
    Frenzied Member swatty's Avatar
    Join Date
    Aug 2002
    Location
    somewhere on earth
    Posts
    1,478
    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
    If you just set them to False in a normal form, then you are still stuck with the icon

    Woka
    I have a form with the borderstyle set to 2 sizable
    the WhatsThisButton to True and MaxButton and MinButton to False

    And they don't show up ?
    Am I missing something here ?
    Code:
    If Question = Incomplete Then
       AnswerNextOne
    Else
       ReplyIfKnown
    End If
    cu Swatty

  16. #16

  17. #17
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    To remove the icon from a form try:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    4. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    5. Private Const GWL_EXSTYLE = (-20)
    6. Private Const WS_EX_DLGMODALFRAME = &H1&
    7.  
    8. Private Sub Form_Load()
    9.  
    10. Dim lexstyle As Long
    11.  
    12. lexstyle = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
    13. lexstyle = lexstyle Or WS_EX_DLGMODALFRAME
    14. Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, lexstyle)
    15.  
    16. End Sub

    Hope this helps,
    Duncan

    See - many of my posts make no mention of the EventVB.dll .... doh!
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  18. #18
    Addicted Member
    Join Date
    Sep 2002
    Location
    Guwahati, Assam, India
    Posts
    131

    Red face But

    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.
    I am new to VB...

  19. #19
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    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..
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width