How to display a tooltip with transparent background.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sanjayamladi
    New Member
    • Apr 2010
    • 7

    How to display a tooltip with transparent background.

    // The below code simply creates a black rectangular area for the tooltip
    // Did I need to do any pinvike stuff to make the background tranparent.
    // What am I really tring to acheive is Opacity of say 10% for the tooltip, so I can see the data on the grid the tooltip is covering.

    Code:
    private void hoverTooltip_Draw(object sender, DrawToolTipEventArgs e)
    {    
        SolidBrush sb = new SolidBrush(Color.Transparent);            
        e.Graphics.FillRectangle( sb, e.Bounds );             
        e.DrawBorder();
        e.DrawText();                
    }
    
    
    private void BidGrid_MouseMove(object sender, MouseEventArgs e)
    {
    HoverToolTip.SetToolTip(sender, sb.ToString());
    }
    Last edited by Curtis Rutland; Aug 6 '10, 07:01 PM. Reason: Please use [CODE][/CODE] tags when posting code
Working...