TPU ChatChat on IRC
Internet Relay Chat?
Java Applet client
Who's on IRC?
Posted by andymcnab [send private reply] at June 18, 2002, 12:19:58 PM Hello, i am doing a scripting languge in VB6 and need to know how to modify the properties of a msgbox at runtime.
EG. Title, Prompt, Icon?????????
Posted by metamorphic [send private reply] at June 18, 2002, 04:17:11 PM title and prompt can be done using variables. The icon can only be one of the set few.
dim strprompt as string dim strtitle as string strprompt = "This is a prompt" strtitle = "MSGBOX Title" msgbox strprompt, vbcritical, title
would make a critical-style message box saying "this is a prompt" with the title "MSGBOX Title".
to change the icon either use a select case or allow the user to type in vbcritical or vbyesno or whatever and substitute it in.
Posted by jbman [send private reply] at June 25, 2002, 01:04:53 AM Actually, to edit message boxes from runtime, you would need to create a few variables. Lets say, you want the user to have their own message. You could create a textbox with the name txtMessage. THen create a command button lets just say its called cmdMsgBox. The code to trigger the message box is:
Private Sub cmdMsgBox()
Dim intResults As Integer
Dim strMessage As String
strMessage = txtMessage.text
'This is to set the text box as the variable 'strMessage'
intResults = MsgBox (strMessage, [buttons go here], "[title goes in here")
There are many options that go with the msgbox. Buttons can be "vbOKOnly" for just an ok button - or "vbYesNo" for yes and no. To interpret the answer - you must look up the values they return. This code is setup so whatever value returned is stored in intResults. You can create an If...End If statement to choose what to do next. For MsgBox return values, check your VB Help section.
Any Questions? Email firstname.lastname@example.org
Posted by buzgub [send private reply] at June 25, 2002, 04:08:07 AM You can't actually modify the properties (which are not even properties in the VB lingo); you can just set them when you call the MsgBox function. Look up said function in the help file.
Register as a new user