Results 1 to 5 of 5

Thread: Using MsgBox icons via API on standard form?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    Hi,

    I'm creating my own message box for various reasons.. I need to be able to use the standard MsgBox icons on my form. I was hoping I could do this via the API. Someone suggested that I use PrintScreen to capture the Icon and then put it on the form in a picture box but I don't like this because the background comes out a little different shade of grey and it looks cheap.. I want to do it the right way..

    The idea is that when I call my home-made message box, I can specify the Icon to use just like the real MsgBox!!!

    Example code would be appreciated.. I'm not an expert in API so please be very descriptive..

    Dan

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Use the printscreen trick and then use a program like Paint Shop Pro, Photoshop, Corel Photopaint,etc. to make it a transparent gif file.

  3. #3
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    The icons are provided if you chose Graphics when you installed VB, They are in the
    Code:
    Microsoft Visual Studio\Common\Graphics\Icons\Computer
    folder

    They are Called:
    • Msgbox01
    • Msgbox02
    • Msgbox03
    • Msgbox04
    • W95mbx01
    • W95mbx02
    • W95mbx03
    • W95mbx04


    If you didn't install the Graphics, i can send them to you

    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  4. #4
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    Here would be some possible code:
    Code:
    
    'in your form
    'put pictureboxes and add all the icons, make them invisble
    'make them into a control array
    
    Function MyMsgBox(Prompt As String, Optional Buttons As vbMsgBoxStyle = vbOkOnly, &_
    Optional Title As String = "Message Box") As vbMsgBoxResult
    
    Me.Caption = Title
    Me.lblCaption = Prompt
    
    If Buttons And vbInformation Then
    Set Me.Icon = Pics(0)
    Set Me.ShowPicture = Pics(0)
    'etc.
    End if
    
    If Buttons And vbOkOnly Then
    Me.OK.Visible = True
    Me.Cancle.Visble = False
    'etc.
    End IF
    'etc.
    End Function
    Oops, sory about that, i must have screwed up and messed it all up, fixed now

    [Edited by gwdash on 10-07-2000 at 11:31 AM]
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  5. #5
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715

    hmmmmmm

    Gwdash, you posted twice.
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

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