Results 1 to 2 of 2

Thread: Win32 API MessageBoxIndirect

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 1999
    Posts
    15

    Post

    I am trying to put my own icon on a message box using messageboxinderect.

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Don't.

    Add a new form to your project and dress it up to look like a messagebox, with a picture box to put your icon in it.

    then add a method to it with all the paramaters you need, and an extra one as an object (Call it OwnerWindow as Object).


    in the code for the method put all the code to change the text, the buttons and your icon as a stdPicture etc.

    use
    Code:
     Set pctIcon = Icon
    to set the picturebox icon and show the form with

    Code:
    
    me.Show vbModal, OwnerWindow
    vbModal tells vb to make the window act like a messagebox and the OwnerWindow sets which object to centre the form in so set it to Me when you call it. remember to set the forms startup position to center in owner. it may need some tweeking to get it right but it should work.

    Hope this helps.

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