Beispiel #1
0
 protected override void OnPaint([NotNull] PaintEventArgs e)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     base.OnPaint(e);
     e.Graphics.DrawRectangle(Pens.Black, 0, 0, Width - 1, Height - 1);
     if (toolTipRenderer != null)
     {
         toolTipRenderer.Draw(e.Graphics, Font, ForeColor);
     }
 }
Beispiel #2
0
 protected override void OnPaint([NotNull] PaintEventArgs e)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     if (toolTipRenderer == null || !active)
     {
         return;
     }
     try
     {
         e.Graphics.TranslateTransform(BorderWidth / 2, BorderHeight / 2);   // border shift
         toolTipRenderer.Draw(e.Graphics, Font, ForeColor);
         e.Graphics.TranslateTransform(-BorderWidth / 2, -BorderHeight / 2); // border shift
     }
     catch (Exception ex)
     {
         Trace.TraceError("Tooltip paint error: {0}", ex.ToString());
     }
 }
 protected override void OnPaint([NotNull] PaintEventArgs e)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     base.OnPaint(e);
     if (toolTipRenderer == null || !active)
     {
         return;
     }
     try
     {
         e.Graphics.DrawRectangle(Pens.Black, 0, 0, Width - 1, Height - 1);
         toolTipRenderer.Draw(e.Graphics, Font, ForeColor);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Trace.TraceError("Tooltip paint error: {0}", ex.ToString());
     }
 }