.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT

Home >> Code Snippets >> Windows Form Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Adding tooltip for image

Posted By:Mahesh       Posted Date: March 02, 2012    Points: 40    Category: Windows Form Controls    URL: http://www.dotnetspark.com  

Following code shows how tooltip for the controls can be added, tooltip for image is demonstrated.

private sub SomeCodeSnippet()
 Me.tooltipMain.ShowAlways = True
 Dim tsi As New ToolStripButton(String.Empty, myImage)
 tsi.ToolTipText = "my tool tip text"
 AddHandler tsi.MouseHover, AddressOf ToolStripItem_MouseHover
end sub

Private Sub ToolStripItem_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs)
 If TypeOf sender Is ToolStripButton Then
  Me.tooltipMain.SetToolTip(Me.toolstripMain, CType(sender, ToolStripButton).ToolTipText)
 End If
End Sub


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend