Ok, well ive made a simple little message box creator. What it does it lets you change the caption the header the buttons and the warning type of a message box. I now want to make it so if you want, you can save the message box youve just created. I have no idea how to do this, keep in mind im still a noob here is a sample of my code so you can see what level im at. (I would prefer it if you could show me how in terms that i would be able to understand.)
Oh BTW ive named the 2 variables for alert type and button combos as "str..."
thats because at first they were strings but then i changed the values to numbers instead of "vbCritical " or "vbYesNo"
Thanks,
HaggardSmurf
Code:
Private Sub cmdCreate_Click() strMessageBoxText = Text2.Text strMessageBoxHeader = Text1.Text Debug.Print "Combo1.Text = "; Combo2.Text If Combo1.Text = "Critical" Then strAlertType = 16 ElseIf Combo1.Text = "Exclamation" Then strAlertType = 48 ElseIf Combo1.Text = "Information" Then strAlertType = 64 ElseIf Combo1.Text = "Question" Then strAlertType = 32 End If If Combo2.Text = "Ok" Then strButtonCombo = 0 ElseIf Combo2.Text = "Ok, Cancel" Then strButtonCombo = 1 ElseIf Combo2.Text = "Yes, No" Then strButtonCombo = 4 ElseIf Combo2.Text = "Yes, No, Cancel" Then strButtonCombo = 3 ElseIf Combo2.Text = "Abort, Retry, Ignore" Then strButtonCombo = 2 ElseIf Combo2.Text = "Retry, Cancel" Then strButtonCombo = 5 End If strMessageBox = MsgBox(strMessageBoxText, strAlertType + strButtonCombo, strMessageBoxHeader) If strMessageBox = vbRetry Then Do strMessageBox = MsgBox(strMessageBoxText, strAlertType + strButtonCombo, strMessageBoxHeader) Loop While strMessageBox <> vbAbort And strMessageBox <> vbIgnore And strMessageBox <> vbCancel End If strTest = MsgBox("Want to do a more advanced test?", vbQuestion + vbYesNo, "More Advanced Test") If strTest = vbYes Then frmMessageBoxCreator.Hide strMessageBox = MsgBox(strMessageBoxText, strAlertType + strButtonCombo, strMessageBoxHeader) If strMessageBox = vbRetry Then Do strMessageBox = MsgBox(strMessageBoxText, strAlertType + strButtonCombo, strMessageBoxHeader) Loop While strMessageBox <> vbAbort And strMessageBox <> vbIgnore And strMessageBox <> vbCancel End If frmMessageBoxCreator.Show End If Debug.Print "Combo1.Text"; Combo2.Text
thats because at first they were strings but then i changed the values to numbers instead of "vbCritical " or "vbYesNo"
Thanks,
HaggardSmurf
Comment