-
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
-
Use the printscreen trick and then use a program like Paint Shop Pro, Photoshop, Corel Photopaint,etc. to make it a transparent gif file.
-
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
-
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]
-
hmmmmmm
Gwdash, you posted twice.