• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

Information pop up in VB6

Hi guys I require your help yet again,
With my very limited knowledge of VB6 i don't know why I use it. (don have time to learn it properly)
ok, need to setup on button that once pressed will create a pop up that can be closed by clicking on a OK button or something similar.
ANything that will help me on my way will be good,

thanks again.
0
pnorris98
Asked:
pnorris98
1 Solution
 
bobbit31Commented:
put a button on your form (name it Command1):

public sub Command1_Click()
   Msgbox "Popup this message"
end sub
0
 
Glen A.IT Project ManagerCommented:
Yup, that will do it.  You can also change the style of the messagebox by adding different paramaters:

ie:

msgbox "Popup this message", vbExclamation
msgbox "Popup this message", vbInformation
msgbox "Popup this message", vbCritical

and there's lots more you can do with the msgbox command as well.  You can use it to input OK/Cancel, Yes/No, and other things.

Hope that helps!
0
 
pnorris98Author Commented:
Hi guys thanx for getting back to me so quick,
I have tried that and works great but what happens when you try to enter say 3 lines of text

Like
public sub Command1_Click()
  Msgbox "Popup this message"
"Popup line 2"
"Popup line 3"
end sub

and while I am here you dont know of any online VB6 tutorials.
Thanks again.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
SweatCommented:
pnorris98,

Text in a MsgBox can be like this:

   Dim stxt As String

   stxt = "This would represent line 1" & vbCrLf
   stxt = stxt & "And then this would be two." & vbCrLf
   stxt = stxt & "Then this is three." & vbCrLf

and so on.  You can also put two vbCrLf's together to create a blank line between lines as well.

Sweat

0
 
kevmeistCommented:
Not sure of online tutorials but there are MANY books available and also MANY websites available with code snippets, such as www.vb2themax.com etc

Kevin
0
 
xThorxCommented:
You can also create a new form in which you add everything you need (text, picture, sound, video or whatever...) and a quit button for exiting the window. Suppose you have this form2 you want to call

in button_click or label_click or ... you can add
form2.show vbmodal

like this you won't be able to use form1 unless form2 if unloaded.

With this method, you can put your window anywhere in your screen. If you use msgbox, if will come in the middle of the screen. The msgbox should only be used when you want to give a feed back to the user when an operation is done or something.
0
 
pnorris98Author Commented:
Thanks for that,
Those exampls came into good use.
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Tackle projects and never again get stuck behind a technical roadblock.
Join Now