|
-
Sep 28th, 2000, 11:32 AM
#1
Thread Starter
Frenzied Member
Hi,
I would like to use some Icons that are native to VB, such as the msgbox icons.. How would I use the msgbox icons seperate from the msgbox? For example, I'm creating my own msgbox with a form and need to use the msgbox icons..
I'm not even sure which extension they use.. I did a search for *.ico but did not see any msgbox icons in the result set.
any help would be appreciated..
Dan
-
Sep 28th, 2000, 11:44 AM
#2
You can use the LoadIcon() API to access the default Windows Messagebox Icons, i.e.
Code:
Option Explicit
Private Declare Function LoadIcon Lib "user32" Alias "LoadIconA" (ByVal hInstance As Long, lpIconName As Any) As Long
Private Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Private Const IDI_APPLICATION = 32512&
Private Const IDI_ASTERISK = 32516&
Private Const IDI_EXCLAMATION = 32515&
Private Const IDI_HAND = 32513&
Private Const IDI_QUESTION = 32514&
Private Sub Command1_Click()
Static lIconID As Long
Dim lIcon As Long
Picture1.Cls
lIcon = LoadIcon(0&, ByVal (lIconID + IDI_APPLICATION))
Call DrawIcon(Picture1.hdc, 0, 0, lIcon)
lIconID = (lIconID + 1) Mod 5
End Sub
-
Oct 1st, 2000, 01:55 PM
#3
Thread Starter
Frenzied Member
Thanks for the help but it doesn't do anything.. The picturebox is just blank..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|