|
-
Nov 2nd, 1999, 01:00 AM
#4
Thread Starter
Junior Member
The solution I found passes through finding the mouse coordinates (its x.y location)in the form at which your bubble needs to be displayed.
To make it easier, go to:
"http://www.vb-world.net/mouse/tip65.html",
and study Steve Anderson's code and example.
Print it.
Then,
1- Create and standard VB6 application and place the Timer (Interval = 1) and 2 Labels (caption = Empty)
2- Follow Anderson's instructions to set your modules and your code right
3- Run (F5) and see how the labels display the mouse pointer coordinates
4- Create a CommandButton and a TextBox. Make the textBox.visible = false and
textbox.name = txtMainBubble, for example.
5- Run the application again and take note of the mouse x & y coordinates at the top-left and bottom-right edges of the CommandButton. Write them down somewhere!
6- Then write the following code (see that I have ammended Anderson's code:
Option Explicit
' DECLARE VARIABLE. POINTAPI IS AT MODULE LEVEL
Dim z As POINTAPI
Dim Wrap$
_________________________________
Private Sub Timer1_Timer()
Dim MyBubbleWords
'ATTRIBUTE BUBBLE TEXT
MyBubbleWords = "bla" + Wrap$ + "bla"
'CALL PROCEDURE
' GET COORDINATES. FUNCTION IS AT MODULE LEVEL
GetCursorPos z
Label1 = "x: " & z.x 'GET X COORDINATE
Label2 = "y: " & z.y 'GET Y COORDINATE
Wrap$ = Chr(13) + Chr(10)
If z.x >= 269 And z.x <= 507 And z.y >= 116 And z.y <= 146 Then
txtMainBubble.Visible = True
txtMainBubble.Text = MyBubbleWords
'RELEASE VARIABLE & HIDE BUBBLE
Else
txtMainBubble.Text = ""
txtMainBubble.Visible = False
End If
End Sub
_____________________
See that z.x and z.y are my own values for the edges of my CommandButton. Use your own values.
If you have more than one commandbutton, then find their edge coordinates and use the If ...Then ...Elseif ...End if statement to display different texts in the textbox.
define MyBubbleWords1, MyBubbleWords2,... etc.
It works fine and could be used pretty much with anything in you form, including pictures, etc, because it deals with the mouse position and nothing else
----------------
Paul Stermann
DSI-Houston
[This message has been edited by prestodsi (edited 11-02-1999).]
[This message has been edited by prestodsi (edited 11-02-1999).]
[This message has been edited by prestodsi (edited 11-02-1999).]
[This message has been edited by prestodsi (edited 11-02-1999).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|