Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there anyway to create popups in a VB

Status
Not open for further replies.

Dpac

Programmer
May 29, 2001
6
0
0
GB
I just started using VB from foxpro 2.6 , is there anyway to create a popup while using a form without having to open another form . I currently have to resort to opening a list box in another form to use stored data ,but there must be an easier way . Any solutions ?????
 
Your post might be somewhat confusing and hence no replies. I am not certain what your intent for 'pop-up' is; however, here is some advice:

The inherent VB controls need not be used for only their intended purposes

Here is an example - Assume I wanted a multi-line help file to appear next to a control only when the right mouse button is pressed (similar to a tooltip). How would I do this?

Just imagining rather quick, I might make a frame and within the frame place a label. The label would fill the entire frame, then I could code:


Private Sub lblTest_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Select Case Button
Case 2: fraMain.Move lblTest.Left, (lblTest.Top + _
lblTest.Height + 50): fraMain.Visible = True:
lblMain.Caption = "This is a test"
Case Else: fraMain.Visible = False
End Select
End Sub


In this fashion you might make a popup with various colours, fonts and so on. By using a frame, you have better control over the Z-order so the 'pop-up' is not hidden behind another control by accident.

- Nick
 
Frames are great for "pop-ups". Making the frame invisible makes all contained controls invisible. You can use the "MouseMove" event to make them disappear when the user waves the "magic mouse cursor" over it. I usually use a counter and wait for 5 "MouseMoves" bacause if the frame becomes visible under the mouse cursor, there is one automatic "MouseMove".
 
you are right the frames are easiest means of getting a simple pop -ups.
But if u need to have a pop-up of various shapes then u have to sub-class the form and create a new window of the shape u require and then use the object of that window everytime the pop-up is required.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top