473,498 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Find Toolbar Button on Mouse Move

Hi All,

How to find the Toolbar Button Index in Mouse Move event on Toolbar.
Thanks
Regards
Sakharam Phapale
Nov 21 '05 #1
4 1979
In the event handler on the MouseMove event,

Select Case toolBar1.Buttons.IndexOf(e.Button)

Case 0

Case 1

etc


--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

"Sakharam Phapale" <sp******@annetsite.com> wrote in message
news:uT**************@TK2MSFTNGP09.phx.gbl...
Hi All,

How to find the Toolbar Button Index in Mouse Move event on Toolbar.
Thanks
Regards
Sakharam Phapale

Nov 21 '05 #2
Hi

Thanks for your reply
But, If I am correct then e.Button is nothing but mouse button
e is MouseEventArgs

So following should not work.
Hopes some explanation on this.

Thanks & Ragards
Sakharam Phapale

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:e$**************@TK2MSFTNGP10.phx.gbl...
In the event handler on the MouseMove event,

Select Case toolBar1.Buttons.IndexOf(e.Button)

Case 0

Case 1

etc


--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

"Sakharam Phapale" <sp******@annetsite.com> wrote in message
news:uT**************@TK2MSFTNGP09.phx.gbl...
Hi All,

How to find the Toolbar Button Index in Mouse Move event on Toolbar.
Thanks
Regards
Sakharam Phapale


Nov 21 '05 #3
Yes, your right, the only way I can think of is this.

//This will give you the bounding rectangle
toolbar1.Buttons.Item(0).Rectangle
//Use the mousevent args ( X,Y ) and the bounding rectangle to discover
which button it is over, Im sure there must be an easier way

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

"Sakharam Phapale" <sp******@annetsite.com> wrote in message
news:Oq**************@tk2msftngp13.phx.gbl...
Hi

Thanks for your reply
But, If I am correct then e.Button is nothing but mouse button
e is MouseEventArgs

So following should not work.
Hopes some explanation on this.

Thanks & Ragards
Sakharam Phapale

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:e$**************@TK2MSFTNGP10.phx.gbl...
In the event handler on the MouseMove event,

Select Case toolBar1.Buttons.IndexOf(e.Button)

Case 0

Case 1

etc


--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

"Sakharam Phapale" <sp******@annetsite.com> wrote in message
news:uT**************@TK2MSFTNGP09.phx.gbl...
Hi All,

How to find the Toolbar Button Index in Mouse Move event on Toolbar.
Thanks
Regards
Sakharam Phapale



Nov 21 '05 #4
* "Sakharam Phapale" <sp******@annetsite.com> scripsit:
How to find the Toolbar Button Index in Mouse Move event on Toolbar.


From my FAQ:

\\\
Imports System.Windows.Forms
..
..
..
Private Sub ToolBar1_MouseMove( _
ByVal sender As Object, _
ByVal e As MouseEventArgs _
) Handles Me.ToolBar1.MouseMove
Dim b As ToolBarButton
For Each b In Me.ToolBar1.Buttons
If b.Rectangle.Contains(New Point(e.X, e.Y)) Then
If Me.StatusBar1.Text <> b.ToolTipText Then
Me.StatusBar1.Text = b.ToolTipText
End If
Return
End If
Next b
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
327
by: Arif | last post by:
I have a bizarre problem. I am using a code module to update the Caption property of the buttons of a custom toolbar. Though the code module works fine, the new caption does not immediately show on...
11
9088
by: Pete | last post by:
Is there any way to change the default search to "Any Part Of Field" instead of whole field? The first thing I ever do when searching for something in a field is change the default setting from...
3
2094
by: Trythat | last post by:
Is it possible to tell which button has been clicked, when using the right mouse button (using the mousedown event). I can tell which button using the 'ToolBar_ButtonClick' but I want to tell...
7
17113
by: Tyron | last post by:
I need to know if the Left Button of the Mouse is clicked in the WM_NCMOUSEMOVE Notification but this Message doesnt contain the Mouse Button States as WM_MOUSEMOVE does. So how can I get them? ...
0
2575
by: AK | last post by:
Hello, Listbox mulitselect property is set to true (extended). I am trying to implement drag and drop feature for a listbox. The drag & drop is done in the mouse move event (DoDragdrop...
3
1148
by: Vikash Yadav | last post by:
hi can any body tell me how to pick up events on toolbar buttons in vb.net i mean to say that i have one toolbar and buttons on it now i want mouseevents on those buttons like mouse over ,mouse...
2
1196
by: JC Voon | last post by:
Hi : How to detect the mouse is move over which ToolbarButton, the ToolbarButton is inherited from Component, and don't have mouse move event, the Toolbar.GetChildAtPoint return control, i...
6
9697
by: marss | last post by:
Hi, How can I define in Firefox whether the left mouse button is pressed when I move mouse over a html element? The documentation says that "e.button == 0 for standard 'click', usually left...
2
5056
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
0
7124
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.