well, thanks for all the spam i will get.[ no hard feelings]
i am completely sorry if that was the impression i caused, of course i do
not mean breaking the spirit of the group, no, sorry again.
Bad zz !! bad zz !!, no cookies for you tonight!!!
so for my redemption.
'// i know it has some 'scratches' and it could have been a little bit more
effective, but i'm under a little pressure to finish this '//before xmas and
as long as it works...
in a regular module called msgs i declared this function
Public returnanswer As Integer ' ///this is a global variable that can be
set from Frmmsg's events
Public Function Messagebox(Msg As String, Title As String, typeofmsg As
Integer) As String
On Error GoTo errhandler
Load Frmmsg '// this loads the userform that 'acts' as the msgbox but
doesn't show it yet
Frmmsg.lblmsg.Caption = Msg '// places the message
Frmmsg.Caption = Title ' // sets the title ,obviously
Select Case typeofmsg
Case Is = 1
Frmmsg.typeofmsj.Picture =
LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgwarn.jpg") '// show
the 'yellow message sphere
Case Is = 2
Frmmsg.typeofmsj.Picture =
LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgerr.jpg") '// show
the
' red sphere pic
Case Is = 3
Frmmsg.typeofmsj.Picture =
LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgsuccess.jpg") '//
show
'the green sphere pic
End Select
Frmmsg.Show
'// this part is for the Messagebox to return a value that
can be handled like the VByes response in a regular msgbox
Select Case msgs.returnanswer
Case Is = 1
Messagebox= "TByes"
Case Is = 2
Messagebox = "TBNot"
Case Is = 3
Messagebox = "TBcancel"
End Select
errhandler:
Err.Clear
End Function
Now
in the Frmmsg i have three buttons one for yes, another for no and a
third for cancel
private sub Btntbyes_onclick
msgs.returnanswer=1 '// this is for the Messagebox function to return
"TByes"
unload frmmsg '// cause we don't need the msg anymore
end sub
private sub Btntbnot_onclick
msgs.returnanswer=2 '// this is for the Messagebox function to return "TBno"
unload frmmsg '// cause we don't need the msg anymore
end sub
private sub Btntbcancel_onclick
msgs.returnanswer=3 '// this is for the Messagebox function to return
"TBcancel"
unload frmmsg '// cause we don't need the msg anymore
end sub
so now i can write
X= Messagebox("Wow " & application.username & " you're handsome!! " &
VbCrlf & " am i right?" ,"Self esteem enhancer",3)
if x="TByes"
then
Messagebox "Liar!!!!","Go back to work",2
else
Messagebox "c'mon!, you know youre not but i still like you the best ","
Please return to your activities",3
endif
actually this is not the purpose for what i use it, but i tought this would
be funnier.
Best regards, hope it may be usefull.
--
:=)
---
zz [MX]
cuasi-musico,semi-poeta y loco
"Tom Ogilvy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 Removed)
>
>
> Doesn't seem like that is in the spirit of the newsgroup?
>
> --
> Regards,
> Tom Ogilvy
>
>
>
> "zz" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote
>> in message news:(E-Mail Removed)...
>>>
>>> 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
>>> --------------------
>>> Hope this helps,
>>> Regards,
>>> Simon
>>>
>>>
>>> --
>>> Simon Lloyd
>>
>>
>
>