|
-
Oct 19th, 2005, 11:35 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Custom button msgbox??
I need to make a msgbox that asks if the user would like to create a new document or add to an old one. i could make it a yes no msgbox and ask if they wish to append. Then if they click no it will create a new one.
But i would prefer not to do it that way i would rather have a msgbox that asks the user this question then one button that says "Append to old" and another that says "Create new".
Is there anyway of doing this or will i have to use my previous (and crap!!) method...
cheers
GTJ
-
Oct 19th, 2005, 11:37 AM
#2
Re: Custom button msgbox??
I don't know what your previous option was, but in order to get a "messagebox" to ask the questions that you want asked, you will have to build your own using a standard VB form.
-
Oct 19th, 2005, 11:59 AM
#3
Re: Custom button msgbox??
Or rather, to offer the answers you want offered 
Once you've made it a form, you can wrap it in a function and show it Modally from within there, so it is just like VB's MessageBox() function.
VB Code:
' In a MessageBox module
Enum CustomMessageBoxResult
mbAppend
mbCreate
End Enum
Function CustomMessageBox(ByRef pszText As String, ByRef pszTitle As String) As CustomMessageBoxResult
Dim objMB As FMessageBox
Set objMB = New FMessageBox
With objMB
.lblText.Caption = pszText
.Caption = pszTitle
.Show vbModal
CustomMessageBox = .Result
End With
Set objMB = Nothing
End Function
and in your FMessageBox form you will need a Result property
VB Code:
Private mResult As CustomMessageBoxResult
' set the above variable and hide the form when the user clicks a button
Friend Property Get Result() As CustomMessageBoxResult
Result = mResult
End Property
Argh, how hard does it have to be to type "CustomMessageBox"
-
Oct 19th, 2005, 12:30 PM
#4
Re: Custom button msgbox??
Of what type is FMessageBox?
-
Oct 19th, 2005, 12:33 PM
#5
Re: Custom button msgbox??
my guess its the new form ?
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Oct 19th, 2005, 12:36 PM
#6
Re: Custom button msgbox??
 Originally Posted by me
your FMessageBox form
Indeed
-
Oct 19th, 2005, 12:37 PM
#7
Re: Custom button msgbox??
 Originally Posted by [A51g]Static
my guess its the new form ?
Yeah, mine too, but someone else reading this post might not make that connection.
-
Oct 19th, 2005, 12:57 PM
#8
Thread Starter
Hyperactive Member
Re: Custom button msgbox??
how do i grey out the 'x' in the top right hand corner??? vb msgboxes have the 'x' greyed out...
-
Oct 19th, 2005, 01:12 PM
#9
Re: Custom button msgbox??
-
Oct 19th, 2005, 01:24 PM
#10
Thread Starter
Hyperactive Member
Re: Custom button msgbox??
disregard my last question about greying out, i just removed it... easier!
another question: where might i get the sound that the msgbox makes if it is a vbinformation msgbox?? (the two notes)
is it in c:\windows... or summin??
-
Oct 19th, 2005, 01:30 PM
#11
Thread Starter
Hyperactive Member
Re: Custom button msgbox??
i have found the sound in c:\windows\media how would i get it to play when the form loads??
-
Oct 19th, 2005, 01:37 PM
#12
Re: Custom button msgbox??
i think its the PlaySound API?
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Oct 19th, 2005, 01:44 PM
#13
Re: Custom button msgbox??
A related question was asked earlier today. You can find it here.
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
|