|
-
Oct 1st, 2000, 09:07 PM
#1
Thread Starter
Frenzied Member
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
-
Oct 2nd, 2000, 05:38 AM
#2
Fanatic Member
Use the printscreen trick and then use a program like Paint Shop Pro, Photoshop, Corel Photopaint,etc. to make it a transparent gif file.
-
Oct 6th, 2000, 03:39 PM
#3
Fanatic Member
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]
-
Oct 6th, 2000, 03:51 PM
#4
Fanatic Member
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]
-
Oct 6th, 2000, 04:31 PM
#5
Fanatic Member
hmmmmmm
Gwdash, you posted twice.
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
|