Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




How To Get A Word Where Mouse Hover?


How to get a word where mouse hover? I mean I wnat to get only one word from any sentense of text that show on windows screen when I hold a mouse hover it. My request is cover on all application that run on windows. I want to get that word and return it to my program for some process.PS. You can found some guide line like this,Windows will return Highlighted Word as result when you double clike on any text.^solaris^




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Mouse Hover
i want to make a button move when the mouse hovers ove rthe button, but i dont know how. ive been looking and ive found that i have to do a mousemove event, but i dont know. any advice?

Mouse Hover
I would like to know how to program a Mouse Hover. So that I can have a picture on the form and as I put the mouse over (not by clicking) it a form that I create comes up!

Thanks for your time!

Please Respond Promptly

Mouse Hover
Hi, what code can i use in the Mouse_Move event so that when an Image1 has a mouse over it, it loads picture1 and when the mouse leaves that image1, picture2 is loaded, thus creating an effect similar to a mouse hover on an internet browser over the forward and back buttons, etc.

Need Help With Mouse Hover Function
Hello,

I have a series of three radio buttons that when checked, change the backColor of a label. When the mouse hovers over the label, the name of the color (of the currently checked radio button) needs to be displayed in another label.

Would someone kindly tell me the code for this, or how to do it.

Thank you for your help!

Changing Props On Mouse Hover
I've searched and looks around for a good example, but mostly found more than I needed, and I am to untrainned to read between the lines with tougher functions and arrays, anyways...

I want to change the forecolor, and the underline properties when the mouse pointer is overtop of a label. Can somebody just post a quick example for just doing that, changing the properties in the example isn't needed :P.

Detecting Mouse Hover Thingy....
Hi,

I had the code for this before, but i lost it. I need to detect mouse movement on a control. I know I can use the MouseMove event, but it doesn't always work. If you move the mouse to quickly, for example, the event doesnt fire. I know there's an API call to detect these things (like I said, I had it before). Can some-one please enlighten me again?

Get A Link's Target URL On Mouse Hover With Web Browser Control?
Hey,

I have a web browser control. When the mouse hovers a link, how can I get its target URL in a variable or something? Then do something else when the mouse moves away from the link.


So....

1) Detect hover of link.
2) Display target URL in status bar control
3) Detect when the mouse leaves the link
4) Clear statusbar text.

Thanks,
-compuXP

How To Get The Mouse Hover Effect On A Subclassed Command Button?
Greetings every1,
I want to subclass a commandbutton and achieve the hover effect, i.e., when the mouse is over the button i want to Bitblt a image on it, and when the mouse is not on it, i want another image on it. Also, when the left mose button is down and cursor is out of the button, i want the image to be revetted to the normal button. Plz help

How To Get The Mouse Hover Effect On A Subclassed Command Button?
Greetings every1,
I want to subclass a commandbutton and achieve the hover effect, i.e., when the mouse is over the button i want to Bitblt a image on it, and when the mouse is not on it, i want another image on it. Also, when the left mose button is down and cursor is out of the button, i want the image to be revetted to the normal button. Plz help

How To Get A Word Where Mouse Over? (Again)
How to get a word where mouse over? (In Any where on Windows Screen)

I hearing something for this case from my friend. I think it so easy than using OCR. My friend tell that all text message on the screen will be handled with Windows and we can use some windows message for get it. But we (My friend and me) don't know that how. Please help me.

For Example, When I hold a mouse over word "Example" in "This is Example Message." that is some text in Internet Explorer (or other program), I want to sent the word "Example" back to my program for process and show some result as Tooltips.

How To Get A Word Where Mouse Over?
How to get a word where mouse over? (In Any where on Windows Screen)
For Example, When I hold a mouse over word "Example" in "This is Example Message." that is some text in Internet Explorer (or other program), I want to sent the word "Example" back to my program for process and show some result as Tooltips.

Hover Over
I am trying to make a label show details of a picture when the user hovers over the picturebox.
This is easy to do in vb.net but i am unsure of how to do it in vb6.
I searched previous forums, and there is one post that is helpful. I have never used user controls and am unsure if i need to use them and how to use them.

Is there an easy way to create a hover control? or could somebody just explain the basic fundamentals of how to this?

thank you in advance

Getting Word Under Mouse Cursor
Hello

this question must have been asked before.. but i noticed in easy lingo dictionay it can get the meaning of the word u hover in a matter of seconds.

i dont need the code as much as discussing the technique...
i have searched about the technique and i found one way like this which only works on Rich TextBox and what i need to do is get the closes character to mouse cursor in the rich text using EM_CHARFROMPOS and SendMessage.
This brings to my attention the problem that the cursor might be over a character which is at the middle of the word
e.g
Hello -> user pusts cursor above e and i will get the list of words beginnign with e which is wrong...

but it has an answer which is that i can see that the character i got from sendmessage is inside my word that i am looking for then do some maths to get the position of the letters b4 that character and after so that i can get the whole word.

i have been also told about hooking and subclassing but i dont know what that has to do with what i am thinking about also my way only works on rich textbox.

any one does have an idea about this or anything that can help me understand the technique and would like to share is welcome

Highlight A Word Without The Use Of Mouse
ive got this code and it transfer words to a listbox from another form but if you dont highlight the word with the mouse it wont transfer to the listbox
here the code that ive got
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim lEnd As Long
Select Case KeyCode
Case vbKeyF1
If rich.SelStart > 0 Then rich.SelStart = InStrRev(rich.Text, " ",rich.SelStart)
lEnd = InStr(rich.SelStart + 1, rich.Text, " ")
If lEnd = rich.SelStart And Not lEnd = 0 Then Exit Sub
rich.SelLength = IIf(lEnd = 0, Len(rich.Text), lEnd - rich.SelStart - 1)
Case vbKeyF2
frm2.lst.AddItem rich.SelText
End Select
End Sub

i need to highlight the word with F1 and transfer it with F2 without the use of the mouse
anyone pls help me

GET A WORD UNDER MOUSE POINTER????
I'm writing a small desktop utilize, but I don't know how to get a text word in a textbox (exact word at mouse pointer). If you know, please tell me api(s) I should use.
Thanks.

Hover Button
How do I add the Hover button to the toolbar list? I can't find it in the component list.

Hover Not Working
I have a new computer with Windows XP and Office 2000 Professional. In by vb code, I am not able to hover over a variable and get it's current value, for example:

Dim e as string
e = "a"
MsgBox(e)

I should be able to put a break on the MsgBox line, hover over e and see that e = "A". This is working on my old computer (same OS/Office), and I cannot find any setting to turn it on or off. Any ideas?

Hover Over Buttons
Does anyone know how to simply hover over a button and have it produce a hint or piece of inforamtion as to what that button does??

ListBox Hover
I have a listbox that is not large enough to see the entire name of some of the contents. It also cannot be resized. Most apps I use will show the whole name if you leave your pointer on the name for a short time. Is this a built in feature of a listbox that I can change (mousepointer property?) or do I need specific code.

I am at work and they do not have help files loaded for VBA. I tried searching "ListBox hover" and just "hover" but I am not sure the answers applied. Any help or a point in the right direction would be appreciated.

Thanks!

Hover Buttons
these are cool, i understand they can only be used on a user control.... can you just add one like you do with a normal component or do you have to write code for it ?

[V6] Hover & Unhover??
When you put your cursor over the start button on windows XP It flashes and when u unhover over it, it turns back to normal.

I have got 2 images where its normal light and when u hover over it it comes light.

What is the code?
or isit a OCX?

Hover Buttons?
Is it possible to create a button that is flat until you put your mouse over the top of it?

Hover Or MouseOver
Does vb have a hover, or onMouseOver function? Something Like it? I just want to change the mouse icon to CrossHair when the mouse is over a graph, and I don't want the user to have to click the graph, just want it to happen when the mouse is over it.

thanks


Paul

Get Text On Hover
I wonder if anyone could tell me how to get a single word that the mouse is hovering over. I know how to do this in a text box, by using SendMessage API and EM_CHARFROMPOS, and then selecting characters until I hit a space; however, this does not work for controls outside of the application form. I guess some API should do the trick but I'm not sure. I think this should be possible to do, because I have seen a program written in C++ that does it exactly.
Maybe some VB genius out there can enlighten me?
Many thanks in advance to anyone who can be bothered to reply and thanks to everyone else who has bothered to read this far :-)

Disabling The Mouse Right Click In MS Word
I've been trying to code a macro which would disable the right click everytime the right button is pressed but to no avail. Could someone out there help me with this. This macro will only work while I am inside the Microsoft Word windows....

Thanks in advance.....

Detect Word Under The Mouse In A Richtextbox
In a rich text box on my form, I need to detect the word under the mouse while the mouse moves.

Any ideas or examples?

Capturing Word That Mouse Clicks...
Have any idea how I can manage to get the word under mouse pointer when user clicks?

This should be a system-wide solution so I can send this word into my application.

Word Under Mouse From Internet Explorer
plz any one help me

i need to capture word under mouse from internet Explorer

Word Macro VBA Mouse Pointer
Hi,

In Word macro programming, is it possible to set the mouse pointer to glasshour while the code is processing? How to do that?

Jeff

Detect Hover In Excel
I'm using the TrackMouseEvent function to raise a mouse hover event. Everything is working just tikketeboo except the constants (which are defined as Hex in every example I can find) don't match any of the messages being sent. I thought I could use the debug window to find a likely candidate, but there's rather alot and I would need to first know what all the messages are. Perhaps someone can shed some light here:

Quote:




Private Const TME_HOVER = &H1&
Private Const TME_LEAVE = &H2&
Private Const WM_MOUSEHOVER = &H2A1
Private Const WM_MOUSEMOVE = &H200
Private Const HOVER_DEFAULT = &HFFFFFFFF




When evaluated, these constants are as follows (in order):
1
2
673
512
-1

The last value is meant to be the timer that qualifies a hover event, so that's clearly wrong for a start. It's occurred to me that VBA interprets Hex differently to VB6. Could someone in the know please confirm/deny these values please?

Hover Button Problems
Hi,

I am using Visual Basic 6.

I'm trying to make a hover button like the ones we see on the web.
I'm using an activeX control to do this.
The control contains an image that appear everytime the mouse touches the control, and a label.
When I click anywhere on the control, a msgbox appears,
but when I click on the image or on the label that are on the control, nothing happens.
I want them to work as if I was clicking on the control itself.

Here's the full ActiveX Control Code:


Code:
Private Declare Function GetCapture Lib "user32" () As Long
Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long

Event Click()
Event DblClick()
Event MouseOver()
Event MouseOut()
Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

Private Sub UserControl_Click()
RaiseEvent Click
MsgBox "You clicked on the control!"
End Sub

Private Sub UserControl_DblClick()
RaiseEvent DblClick
End Sub

Private Sub UserControl_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseDown(Button, Shift, X, Y)
End Sub

Private Sub UserControl_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseUp(Button, Shift, X, Y)
End Sub

Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call doHover(Button, Shift, X, Y)
End Sub

Private Function doHover(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static bMouseOver As Boolean

If GetCapture <> hwnd Then
SetCapture hwnd
If bMouseOver = False Then
bMouseOver = True
RaiseEvent MouseOver
End If
RaiseEvent MouseMove(Button, Shift, X, Y)
Else
If (X < 0) Or (X > ScaleWidth) Or (Y < 0) Or (Y > ScaleHeight) Then
ReleaseCapture
pic1.Visible = True
pic2.Visible = False
bMouseOver = False
RaiseEvent MouseOut
Else
RaiseEvent MouseMove(Button, Shift, X, Y)
pic2.Visible = True
pic1.Visible = False
End If
End If
End Function

I tried this:

Code:
Private Sub lblLabel_Click()
RaiseEvent Click
End Sub
But it doesn't work.

Any tips are welcome.

Edit: corrected coloring

Label Forecolor Hover
Hey guys, new to Visual Basic 6. I can't get a label's color to change when I hover over it...

I'm unsure of what Declarations to use to get it to work

What I want: My Label1.Caption's color to change when my Mouse hovers over it. I would think something like MouseOver would work... Any help guys?

I want it to change when it's over and change back when it leaves. Thanks in advance!

Hover Command Control ?
I was wondering if anyone has used the HoverCommand Control? I found the control here

http://www.elitevb.com/content/01,0044,01/


My question is, How can I set the mouse pointer for this control as there is no provision in the control to set the vb mouse pointer.

Command1 Hover Over The MSHFlexGrid1
Looks like I solved the problem, though the Command1 doesnt show until I click the row. What I need is for Command1 to show when I move my mouse over the first column and over the row for which button would show. Did I get you confused? I am confused myself already, please take a look:

VB Code:
Option Explicit    Private Sub Form_Load()    MSHFlexGrid1.Cols = 5    MSHFlexGrid1.Rows = 10    MSHFlexGrid1.FixedCols = 1    MSHFlexGrid1.FixedRows = 1    MSHFlexGrid1.ColWidth(0) = MSHFlexGrid1.Width * 0.25    Command1.Visible = FalseEnd Sub Private Sub MSHFlexGrid1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)    If x < MSHFlexGrid1.ColWidth(0) Then        Command1.Visible = True        Command1.Move MSHFlexGrid1.Left, MSHFlexGrid1.CellTop + MSHFlexGrid1.Top, MSHFlexGrid1.ColWidth(0), MSHFlexGrid1.RowHeight(0)    Else        Command1.Visible = False    End IfEnd Sub


Please let me know if you see whats wrong with my code. Thanks!

Toolbar Or Hover Button?
hi, i need to make a button with small picture at the left side and text from the right side i want this like in the toolbar of vb if u see the save icon when you point the cursor the hover button is performed. what should i do?

thanks

Hover-over Or Right Click An Image
Is it possible to either
A) Hover over a picturebox and display an image, like the ToolTipText would display text
B) Right click on the picturebox and have a list come up where you can select Properties and such

Hover Over Cmd Button With Pop Up Dialog
Is there a way that when the user puts the cursor over a command button, that you can make a pop up dialog box that says that the command button is?

Hover Command Control ?
I was wondering if anyone has used the HoverCommand Control? I found the control here

http://www.elitevb.com/content/01,0044,01/


My question is, How can I set the mouse pointer for this control as there is no provision in the control to set the vb mouse pointer.

Hover Effect Any1, Plz Help
I have attached a sample project, plz help me any1 by modifying the code to get a hover effect and when the mouse button is down and cursor is not over the button, i want it to revert back to the original image. Plz help

Limiting Right-Click Mouse Options In Word
How can I alter the mouse options in Word so that, for instance, when I right-click the mouse the "Copy", "Cut" and "Paste" functions are not available?

Mouse/cursor Position In Word Document
I'm using Word automation in my VB6 application.
*What i want to do:
-I have several textbox shapes. When i click in one (Postalcode) i am showing a button (is a small vb form, so the word textboxshape keeps focus).
This allready works fine. Only i can't get the form/button to position corectly.
I want it placed right to the active TextBoxshape. The problem is getting the correct screen x y for this to place my form. I can't use api GetCursorPos because this follows the mousecursor and is not reliable. Getting the textbox x y i can do

Code:set Tbox = Appword.selection.ShapeRange
pt.x = scalex( Tbox.left, vbpoints,vbtwips)
pt.y = scaley(tbox.top,vbpoints, vbtwips)

frmPostalCode.show vbmodeless
frmPostalCode.Move pt.x, pt.y

'I probable should allso add the Word window left and top.
pt.x = scalex( Tbox.left + AppWord.left, vbpoints,vbtwips)
pt.y = scaley(tbox.top+AppWord.Top,vbpoints, vbtwips)
Only these x y values aren't correct (to small) probably caused by the word document's position having gray area around , i should then proably get the coordinates of the left top position of the white document leftup corner.

*An alternative solution would be to create a button/picture in word doc itself.
Only more difficult to keep the focus on the active textboxshape. Allso a don't wonna use a command button (try to avoid using the Word build in VBA designer). The above solution with vbform seems better to me.

The result wil be this. Word document is open. User clicks on postal textbox shape, a arrowbutton amerges. User clicks arrowbutton and a dbgrid form popsup and user browses to the destination corresponding and pushes the arrowbutton again, which now fills in the Locationfield next to the postalcodefield/textboxshape.
 





Edited by - lvermeersch on 11/21/2005 11:07:13 PM

Word Macro To Take Mouse Cursor Position
I have to mark students diagrams and charts etc submitted in MS Word. I have word macros that will create a callout, transparent, in blue, or a large tick in a transparent text box with no border.
I have to drag these from the position on the page where they appear, to where I want them over the students diagram.
Does anyone know how to make a textbox appear at the position of the mouse cursor on the page, using a macro? A working macro that I can then edit to add ticks etc would be very useful.

Even better if it works on Word versions back to 97.

Peter

Disable 'The Hands' Hover Button
I have been making good use of Garrett Servers hover button control available at:

http://www.elitevb.com/search.aspx?q...on&st=on&sd=on

I have a number of hover command buttons in my application, but I'm having trouble with the enabled states.
For example when hoverButton1 is clicked, I want hoverButton2 to be disabled, and hoverButton3 to be enabled.

However, it seems that when I use code such as
hoverButton2.Enabled = False
the whole button with all my nice graphics dissappear.
I don't want the button/graphics to dissappear, I just want it to not be clickable or possibly have a new 'disabled' state which I could attach an image to.

Any help would be appreciated. Thanks.

Hover Button In Visual Basic?
Hi. Can you please tell me how to change the visibility of a command button by moving the mouse over it? Right now, I only know how to change the visibility to False by Clicking it.

I want to do this, because I want to create a small joke EXE file, like the ones that are sent in the E-Mail, that ask a question and have -YES- -NO- buttons, but you can only click the yes... because when you go to choose no, the mouse hovering over it changes the yes with the No..


PLEASE HELP!
thanks

Matt

Listview Highlight Hover Selection
Hi, can anybody help display SplitMsg(3) as a highlight when i hover over an item in the listview control


VB Code:
Public Sub UpdatePlayerList(Msg As String)Dim SplitMsg() As StringDim FirstMsg() As StringDim lvwItem As ListItemDim MainListCount As IntegerDim i As Integer frmMain.LstUsers.ListItems.Clear FirstMsg = Split(Msg, Chr$(1))For i = 0 To UBound(FirstMsg) - 1SplitMsg = Split(FirstMsg(i), "+")Set lvwItem = frmMain.LstUsers.ListItems.Add(, , SplitMsg(0))    lvwItem.SubItems(1) = SplitMsg(1)Next  MainListCount = frmMain.LstUsers.ListItems.CountfrmMain.lblPlayers.Caption = MainListCountEnd Sub

Label Control - Hover Links!!!
I have several labels on my VB form each representing an email address (link). I want the email
text to be underlined when I mouse over it and normal when mouse off it (just like a web page).
Is this possible in VB??? If so, how do I do it???

Many thanks

How To Capture Mouse-click Event For A Paragraph In MS WORD.
Friends,
Some of the buttons in MS office toolbars have additional functionality when you double click them.. e.g. Format painter button in Word. When this button is double clicked it stays selected and subsequent document clicks are captured and the selected word/sentence are formatted. I want to make a similar button which remains pressed when it is double clicked and then inserts a word at the curser position whenever i click the document.
Would be glad if someone helps me in this.
Laila

Making My Own Button Control, Hover Issue....
Hi.

Im soon done with my very first home made button. I want the button to have 4 states. Normal, Hover, Pressed & Disabled. These 3 am I done with, Norm, Pressed & Disabled. But I can't get the hover thingie to work.

The button is built with 4 pictures that represent the 4 states, Norm, Pressed, Hover and Disabled. The thing I have a problem with is that I want the picture to change to the Hover picture when the mous is over the picture and to get back to the Norm poicture when not over the picture.

Not over Over Not Over
Norm -> Hover -> Norm

But I can't get it to work.

Here is my code without the hover part:

Code:
Option Explicit

Public Event Click()

Private Sub UserControl_Initialize()

ButtonAlign
ResizeForm
Visibility

End Sub

Private Sub imgNorm_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = vbRightButton Then Exit Sub
imgNorm.Visible = False
imgHover.Visible = False
imgDisabled.Visible = False
imgPressed.Visible = True

End Sub

Private Sub imgNorm_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = vbRightButton Then Exit Sub
imgNorm.Visible = True
imgHover.Visible = False
imgDisabled.Visible = False
imgPressed.Visible = False

If Button = vbLeftButton Then
If X >= 0 And X <= imgNorm.Width And Y >= 0 And Y <= imgNorm.Height Then
RaiseEvent Click
End If
End If
End Sub

'*************************************
'*************************************
'**** Properyt Bag *******************
'*************************************
'*************************************
Private Sub UserControl_WriteProperties(pb As PropertyBag)
With pb
.WriteProperty "Enabled", UserControl.Enabled
End With
End Sub

Private Sub UserControl_ReadProperties(pb As PropertyBag)
UserControl.Enabled = pb.ReadProperty("Enabled", True)
End Sub

'*************************************
'*************************************
'**** Properties *********************
'*************************************
'*************************************
Public Property Get Enabled() As Boolean
Enabled = UserControl.Enabled
End Property

Public Property Let Enabled(ByVal NewEnabled As Boolean)

UserControl.Enabled = NewEnabled

If NewEnabled = False Then
imgNorm.Visible = False
imgHover.Visible = False
imgDisabled.Visible = True
imgPressed.Visible = False
Else
imgNorm.Visible = True
imgHover.Visible = False
imgDisabled.Visible = False
imgPressed.Visible = False
End If
End Property

'Options *********************
Private Sub Visibility()

imgNorm.Visible = True
imgHover.Visible = False
imgDisabled.Visible = False
imgPressed.Visible = False

End Sub

Private Sub ResizeForm()
'Resize the form

UserControl.Width = imgNorm.Width
UserControl.Height = imgNorm.Height

End Sub

Private Sub ButtonAlign()
'Aligns the pictures in the top left corner

imgNorm.Left = 0
imgNorm.Top = 0
imgHover.Left = 0
imgHover.Top = 0
imgPressed.Left = 0
imgPressed.Top = 0
imgDisabled.Left = 0
imgDisabled.Top = 0

End Sub
Can any one help me???

Hover Triggers A Change Of ForeColor Of One ListView Row
When "hovering" (MouseMove) over a row in a listview, I would like to temporarily change the ForeColor property of that one row.

There seems to be an error in the code offered in this post by "anotherVBnewbie":
http://www.vbforums.com/showthread.p...ricky+listview

(I get a compiler error, stating that LVM_HITTEST is not defined)

...but I think it is on the track towards what I want to do.

Rather than:


VB Code:
If (lItemIndex >= 1) And (lItemIndex <= listview.ListItems.Count) Then   listview.ToolTipText = "whatever you want to tip to be"Else   listview.ToolTipText = ""End If

I would probably need something like:

VB Code:
If (lItemIndex >= 1) And (lItemIndex <= listview.ListItems.Count) Then   listview.ListItems(lItemIndex).ForeColor = &H8080FFElse   listview.ListItems(lItemIndex).ForeColor = &HFFFFC0End If


Anybody got an easy solution to this?

TIA,

Dennis

Copyright 2005-08 www.BigResource.com, All rights reserved