473,322 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

StatusBar & ContextMenu question

Hello!

I have Windows Form application containing StatusBar (sb below) and also
ContextMenu for this StatusBar. StatusBar contains 2 panels, and I want to
show ContextMenu only if the MousePointer is on the sb.Panels(1) (and right
MouseButton is used) - how to do it? Maybe code below needs to be changed
but how ?

Private Sub sb_MouseUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles sb.MouseUp

If e.Button = MouseButtons.Right Then

ShowContentMenu(sender)

End If

End Sub

Thanks in advance!

Mika from Finland
Nov 20 '05 #1
3 1257
Hi Mika,

I'm just going out so I can't give you details.

MouseUp will give you the position of the Mouse. You can obtain the
position and sizes of the Panels and determine which one the mouse is over.

Sorry, I'm literally just popping in, so can't say more.

Regards,
Fergus

Oh, a-drumming and a-dancing - I will go, tra la la.... ;-)
Nov 20 '05 #2
* "Mika Mähönen" <mi**********@kolumbus.fi> scripsit:
I have Windows Form application containing StatusBar (sb below) and also
ContextMenu for this StatusBar. StatusBar contains 2 panels, and I want to
show ContextMenu only if the MousePointer is on the sb.Panels(1) (and right
MouseButton is used) - how to do it? Maybe code below needs to be changed
but how ?


Try this:

\\\
Private Sub StatusBar1_PanelClick(ByVal sender As Object, ByVal e As System.Windows.Forms.StatusBarPanelClickEventArgs) Handles StatusBar1.PanelClick
If e.Button = MouseButtons.Right Then
Select Case True
Case e.StatusBarPanel Is Me.StatusBarPanel1
...
Case e.StatusBarPanel Is Me.StatusBarPanel2
...
End Select
End If
End Sub
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Lol

Or use Herfried's method - it's easier.
Nov 20 '05 #4

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

Similar topics

1
by: Peter Zentner | last post by:
Hi all, if I assign a context menu to a treeview and popup the contextmenu with the APP-key the context menu appears in the center of the treeview control and not at the selected treenode. Is...
4
by: Thomas | last post by:
Hi there, I have an iframe which is editable (designMode = "on") and want to resize it dynamically as the content grows (e.g. more lines of text is in there) and there the struggle starts. I...
1
by: Peter Zentner | last post by:
Hi all, if I assign a context menu to a treeview and popup the contextmenu with the APP-key the context menu appears in the center of the treeview control and not at the selected treenode. Is...
10
by: Sender | last post by:
somebody wrote the solution for this many many days ago on this newsgroup....but I lost the notes..... and everyone knows how hard it is to search on newgroups (archives).... so here I am asking...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.