Custom msgbox help needed!!!

Z

zz

hi everyone, it's me again buggin off with me little project that's driving
me insane.

this time is somthing i just like to call a nice feature in my VBA based
app.

i hace created a custom msgbox that show a different image depending on the
typeofmsg parameter i pass into a function

i kindda declare my function like follows:



public function showmsg (msg as string,title as string, typeofmsg as
integer)


into the function you can see [ actually not yet, til i finish my project]

'/// important, i set the frmMsg properties because i use the same userform
everytime i need to display a msg.


frmMsg.LblMsg.caption=Msg '// this is the message displayed

frmMsg.Caption= title ' // this is the title of my custom Msgbox

'// here i select if the typeofmsg is equal to an errormsg or a wrningmsg or
an allOKmsg
select case typeofmsg
case is =1
frmMsg.Pct.Picture=IMG1 ' //IMG1 is an object containing the errormsg
image
case is =2
frmMsg.Pct.Picture=IMG2 ' //IMG2 is an object containing the wrningmsg
image
case is =3
frmMsg.Pct.Picture=IMG3 ' //IMG3 is an object containing the allOKmsg
image

end select



till this point everything works just fine

every time i call showmsg("Crap!","Told you!!",1)


the nice popup windows does it's job.


but now i need an extra from this lil ' fellow, i need it to return a
value, like the regular msgbox

EG,

when i say X=msgbox("dude!, what are you smokin' ?, are you for real??
",VByesnocancel,"be aware, your files will be deleted!!!")

i can know if X=VByes or X=VBno

so now, i need ideas about implementing this in my function


any help will be welcome!!!!


thanks in advantage!!
 
S

Simon Lloyd

Hi not sure entirely what you want to do but this is how to make use of
Yes, No and Cancel from a message box:


Code:
--------------------
Sub Mbox()
Select Case MsgBox("What Now", vbYesNoCancel, "Decision Maker")
Case vbYes
MsgBox "Good"
Case vbNo
MsgBox "Bad"
Case vbCancel
MsgBox "Ugly"
End Select

End Sub
 
Z

zz

thanks for the reply but i have already figured it out !!!...

if anybody wants to know how send me an email to
Jarious[dot]com[at]gmail[dot]com
 
T

Tom Ogilvy

You mean if I was reading this thread and I wanted to find out the solution,
I would need to send an email to


(e-mail address removed)


Doesn't seem like that is in the spirit of the newsgroup?

--
Regards,
Tom Ogilvy



zz said:
thanks for the reply but i have already figured it out !!!...

if anybody wants to know how send me an email to
Jarious[dot]com[at]gmail[dot]com


--
---
zz [MX]
cuasi-musico,semi-poeta y loco

Simon Lloyd said:
Hi not sure entirely what you want to do but this is how to make use of
Yes, No and Cancel from a message box:


Code:
--------------------
Sub Mbox()
Select Case MsgBox("What Now", vbYesNoCancel, "Decision Maker")
Case vbYes
MsgBox "Good"
Case vbNo
MsgBox "Bad"
Case vbCancel
MsgBox "Ugly"
End Select

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top