[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
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.
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" :lol:
Re: Custom button msgbox??
Of what type is FMessageBox?
Re: Custom button msgbox??
my guess its the new form ?
Re: Custom button msgbox??
Quote:
Originally Posted by me
your FMessageBox form
Indeed ;)
Re: Custom button msgbox??
Quote:
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.
Re: Custom button msgbox??
how do i grey out the 'x' in the top right hand corner??? vb msgboxes have the 'x' greyed out...
Re: Custom button msgbox??
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??
Re: Custom button msgbox??
i have found the sound in c:\windows\media how would i get it to play when the form loads??
Re: Custom button msgbox??
i think its the PlaySound API?
Re: Custom button msgbox??
A related question was asked earlier today. You can find it here.