Results 1 to 5 of 5

Thread: Checkbox in messagebox????

  1. #1
    Lively Member
    Join Date
    Jul 02
    Posts
    91

    Exclamation Checkbox in messagebox????

    Hi guys,

    I want to place a checkbox in the messagebox. (similar to one that we see in applications having -> 'Do not show this message again!')

    I think this is possible using subclassing.

    Can anyone show how???

    Thanks,

  2. #2
    PowerPoster
    Join Date
    Aug 00
    Location
    India
    Posts
    2,288
    I think it is not possible, but you never know it just might be possible using all those api calls. Anyway, you always have the option of creating your own msgbox.

  3. #3
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 02
    Location
    England
    Posts
    1,444
    I'm pretty sure you can do it, as I saw a submission on planet source code once that changed the text in the buttons on an MSGBOX. And the guy said that if you changed his code a little you could add things like checkboxes. It would probably be pretty hard though.

  4. #4
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 01
    Location
    Dublin, Ireland
    Posts
    1,616
    In VB it is easier (by a factor of 100) to make your own form that looks like a message box but has a checkbox as well. You can use the API calls DrawIcon and GetStockObject to draw the messagebox icons.

    VB Code:
    1. Declare Function DrawIcon Lib "user32" Alias "DrawIcon" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
    2.  
    3. Declare Function GetStockObject Lib "gdi32" Alias "GetStockObject" (ByVal nIndex As Long) As Long
    4.  
    5. Public Enum IconTypes
    6.   IDI_APPLICATION = 32512&
    7.   IDI_ASTERISK = 32516&
    8.   IDI_EXCLAMATION = 32515&
    9.   IDI_HAND = 32513&
    10.   IDI_QUESTION = 32514&
    11. End Enum

    HTH,
    Duncan
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  5. #5
    PowerPoster
    Join Date
    Aug 00
    Location
    India
    Posts
    2,288
    Originally posted by Rick Bull
    I'm pretty sure you can do it, as I saw a submission on planet source code once that changed the text in the buttons on an MSGBOX. And the guy said that if you changed his code a little you could add things like checkboxes. It would probably be pretty hard though.
    Can you post the link to the PSC? I know you can change the font of a MessageBox, but including a checkbox would mean loading the checkbox, then re-assigning its parent to messagebox. Ther in lies the problem.

Posting Permissions

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