473,804 Members | 3,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Statusbar and menu

Hi everybody!

In VB.NET 2005, MenuStrip and Statusstrip controls added. When the mouse
over on the Menuitem its corresponding Tooptip text should be displayed in
the statusstrip.

How to display the statusstrip text while mouseover on the menuitem?

--
Thanks
S.Viswanathan
Aug 8 '07 #1
3 2340
Example originally from Microsoft
http://home.comcast.net/~kevininstru...nu_Example.zip

"S. Viswanathan" <vi**@ewaksoft. comwrote in message
news:%2******** *******@TK2MSFT NGP06.phx.gbl.. .
Hi everybody!

In VB.NET 2005, MenuStrip and Statusstrip controls added. When the mouse
over on the Menuitem its corresponding Tooptip text should be displayed in
the statusstrip.

How to display the statusstrip text while mouseover on the menuitem?

--
Thanks
S.Viswanathan


Aug 8 '07 #2
There are much better ways of doing it...

http://forums.microsoft.com/MSDN/Sho...32007&SiteID=1

better way to do it... make an IExtenderProvid er that extends the menu items
and/or toolstrip items or other objects to handle this
"ke************ *@state.or.us" <Ke************ ***@state.or.us wrote in
message news:OE******** ******@TK2MSFTN GP02.phx.gbl...
Example originally from Microsoft
http://home.comcast.net/~kevininstru...nu_Example.zip

"S. Viswanathan" <vi**@ewaksoft. comwrote in message
news:%2******** *******@TK2MSFT NGP06.phx.gbl.. .
>Hi everybody!

In VB.NET 2005, MenuStrip and Statusstrip controls added. When the mouse
over on the Menuitem its corresponding Tooptip text should be displayed
in
the statusstrip.

How to display the statusstrip text while mouseover on the menuitem?

--
Thanks
S.Viswanatha n



Aug 9 '07 #3
I like it although it is flawed in SetStatusMessag e.

1. Add the component, menu and statusbar to a form
2. Create a menu item, set the tool tip.
3. Move off the the propery StatusMessage
4. Move back to the propery and change the text.
5. Move off, the original text is retained.

As coded I would only code the tips via code and mark that propery as
<Browsable(Fals e)unless someone else knows how to fix this issue.
Otherwise an excellent idea.

Imports System
Imports System.Collecti ons
Imports System.Componen tModel
Imports System.Windows. Forms
<System.Drawing .ToolboxBitmap( GetType(System. Windows.Forms.S tatusBar))_
<ProvidePropert y("StatusMessag e", GetType(Compone nt))_
<Description("T ool tip to display in your statusbar")_
Public Class StatusMessage
Inherits Component
Implements IExtenderProvid er

Dim mControlLookup As Hashtable = New Hashtable
Dim mLastMessage As String = String.Empty
Public Sub SetStatusMessag e(ByVal senderComponent As Component, ByVal
strMessage As String)
If Not mControlLookup. Contains(sender Component) Then
mControlLookup. Add(senderCompo nent, strMessage)
Dim pMenuItem As ToolStripMenuIt em = CType(senderCom ponent,
ToolStripMenuIt em)
If pMenuItem IsNot Nothing Then
AddHandler pMenuItem.Mouse Move, AddressOf Handle_MenuSele ct
AddHandler pMenuItem.Mouse Leave, AddressOf Handle_MenuLeav e
AddHandler pMenuItem.Mouse Enter, AddressOf Handle_MenuEnte r
Else
' Bug
mControlLookup( senderComponent ) = strMessage
End If
End If
End Sub
Public Function GetStatusMessag e(ByVal senderComponent As Component) As
String
If mControlLookup. Contains(sender Component) Then
Return mControlLookup( senderComponent ).ToString
End If
Return String.Empty
End Function

Public Function CanExtend(ByVal senderComponent As Object) As Boolean
Implements System.Componen tModel.IExtende rProvider.CanEx tend
Return TypeOf senderComponent Is ToolStripMenuIt em
End Function

Private mStatusBar As ToolStripStatus Label

Public Property StatusBar() As ToolStripStatus Label
Get
Return mStatusBar
End Get
Set(ByVal value As ToolStripStatus Label)
mStatusBar = value
End Set
End Property

Private Sub Handle_MenuSele ct(ByVal pControl As Object, ByVal e As
MouseEventArgs)

If StatusBar Is Nothing Then
Exit Sub
End If

If mControlLookup. Contains(pContr ol) Then
If Not mControlLookup( pControl).ToStr ing.Trim = String.Empty Then
StatusBar.Text = mControlLookup( pControl).ToStr ing
End If
End If
End Sub

Private Sub Handle_MenuLeav e(ByVal pControl As Object, ByVal e As
EventArgs)
If StatusBar Is Nothing Then
Exit Sub
End If
StatusBar.Text = Me.mLastMessage
End Sub

Private Sub Handle_MenuEnte r(ByVal pControl As Object, ByVal e As
EventArgs)
If StatusBar Is Nothing Then
Exit Sub
End If
Me.mLastMessage = StatusBar.Text
End Sub
End Class
"Smokey Grindel" <no****@nospam. comwrote in message
news:ud******** ******@TK2MSFTN GP05.phx.gbl...
There are much better ways of doing it...

http://forums.microsoft.com/MSDN/Sho...32007&SiteID=1

better way to do it... make an IExtenderProvid er that extends the menu
items and/or toolstrip items or other objects to handle this
"ke************ *@state.or.us" <Ke************ ***@state.or.us wrote in
message news:OE******** ******@TK2MSFTN GP02.phx.gbl...
>Example originally from Microsoft
http://home.comcast.net/~kevininstru...nu_Example.zip

"S. Viswanathan" <vi**@ewaksoft. comwrote in message
news:%2******* ********@TK2MSF TNGP06.phx.gbl. ..
>>Hi everybody!

In VB.NET 2005, MenuStrip and Statusstrip controls added. When the mouse
over on the Menuitem its corresponding Tooptip text should be displayed
in
the statusstrip.

How to display the statusstrip text while mouseover on the menuitem?

--
Thanks
S.Viswanath an




Aug 9 '07 #4

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

Similar topics

4
2386
by: Tonya | last post by:
Hi, Does anyone know how i can add controls to a progress bar. I have searched the internet but could not find any examples. what i want to add is a progress bar and a button. thx
18
2504
by: Andrew Poulos | last post by:
If I manage to call the following bit of javascript in IE and MZ w = window.open("", "s", 'status=no,resizable=no,width=450,height=450'); I get a window that is not resizable and without a statusbar. Yet FF gives me both a statusbar and the window is resizable! Does this mean that FF does not support these "features" or is there a different way to code them for FF?
1
2570
by: Ahmet | last post by:
In my application, I have statusbar on which i show icons. On some cases, I have to change icon of my statusbar to show different messages on panels. But I dont know how to change icon of one panel of statusbar on runtime. Any help ?
3
3652
by: TonyM | last post by:
Hi all, I have an application with a few different Windows forms. I am trying to update a statusbar panel's text that is in the main form, from another form. When I set the statusbar and the statusbar panels to public and shared in VS.net's property box it will work. However, whenever I make any modifications to the main form it will remove the shared property and I will get build errors about accessing the panels with "this.".
9
2085
by: Christian Blackburn | last post by:
Hi Gang, I've had this happen with a couple of controls now, but my patience has worn thin. Can somebody tell me why I can read/write to most objects on my form from my module, but not when working with StatusBar.Text? Thanks in Advance, Christian Blackburn My Code: Public Class frmMain
6
1536
by: Anony | last post by:
Hi All, I have two icons: Private micoIcon1 As New System.Drawing.Icon(System.IO.Path.Combine(Application.StartupPath, "Icon1.ico")) Private micoIcon2 As New System.Drawing.Icon(System.IO.Path.Combine(Application.StartupPath, "Icon2.ico"))
14
2144
by: Kishan Hathiwala | last post by:
Hi i have kept a statusbar in the form with panels = true. and total there 3 panels. whenever i click on the 3rd panel a menu appears showing online and offline and either is enable at a time. once i clic on online its icon changes to connecticon (assume its there) and whenever i click on offline, its icon changes to disconnection (assume this is also there). now the problem is i have kept one icon for connection (ie when its online -...
1
2695
by: herve | last post by:
Hi, everybody I'm working with wxPython 2.8.1.1. Does anybody know how to change the foreground colors in a wx.StatusBar
0
9711
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10594
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10331
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10087
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9166
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5529
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
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.