-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: venkat_kl
Message 5 in Discussion
Hi MUTHU00004, Try This Title Change a TreeView control's tooltip
when the mouse moves over different nodes in VB .NET Description This example
shows how to change a TreeView control's tooltip when the mouse moves over
different nodes in Visual Basic .NET.
cprogram makes three types of TreeView nodes representing factories, groups,
and persons. It sets each makes an associated object for each node and assigns
it to the node's Tag property. It makes a FactoryData object for a factory
node, a GroupData object for a group node, and a PersonData object for a person
node. These objects don't do much in this example but you can give them
whatever data you want
The trvOrg_MouseMove event handler uses the TreeView control's GetNodeAt method
to see which node is under the mouse. If this is different from the previous
node, the routine checks the type of the node's Tag object. It then sets the
TreeView control's Tooltip to that object's Name property.
Note that a control doesn't have its own Tooltip property in Visual Basic .NET.
Instead a related ToolTip control provides tooltips for various controls. This
code uses the ToolTip control's SetToolTip method to set the tooltip for the
TreeView. Private Sub trvOrg_MouseMove(ByVal sender As Object, ByVal _ e As
System.Windows.Forms.MouseEventArgs) Handles _ trvOrg.MouseMove ' Find
the node under the mouse. Static old_node As TreeNode Dim node_here As
TreeNode = trvOrg.GetNodeAt(e.X, e.Y) If node_here Is old_node Then Exit
Sub old_node = node_here ' See if we have a node. If old_node Is
Nothing Then ttOrg.SetToolTip(trvOrg, "") Else ' Get this
node's object data. If TypeOf node_here.Tag Is FactoryData Then
Dim factory_data As FactoryData = _
DirectCast(node_here.Tag, FactoryData) ttOrg.SetToolTip(trvOrg,
factory_data.Name) ElseIf TypeOf node_here.Tag Is GroupData Then
Dim group_data As GroupData = _ DirectCast(node_here.Tag,
GroupData) ttOrg.SetToolTip(trvOrg, group_data.Name) ElseIf
TypeOf node_here.Tag Is PersonData Then Dim person_data As
PersonData = _ DirectCast(node_here.Tag, PersonData)
ttOrg.SetToolTip(trvOrg, person_data.Name) End If End If End
SubbyeVenkat_KL
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]