New problem with User control...derived class..
From: Graham Blandford (graham.blandford_at_sympatico.ca)
Date: 07/14/04
- Next message: Cablewizard: "Re: converting int to char"
- Previous message: The Grim Reaper: "Re: Tooltips"
- Next in thread: Ken Tucker [MVP]: "Re: New problem with User control...derived class.."
- Reply: Ken Tucker [MVP]: "Re: New problem with User control...derived class.."
- Reply: Mick Doherty: "Re: New problem with User control...derived class.."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 14 Jul 2004 18:05:59 -0400
OK, having answered my questions in a previous feed about pulling my derived
class into the IDE....
Here's a new problem that I'm hoping can be fixed and isn't a .NET bug....
I have created an inherited class based on the textbox... which, all I am
doing is allowing a forecolor to be set when .enabled is set to true.
it works nicely, EXCEPT that when I click into the box, the font (set as
default MS Sans 8.25pt) does not appear to be used and instead what looks
like an Arial 10pt or larger is used - and there is some messy painting
going on.....doesn't clear the original text and the 2 fonts run into each
other...
Here's the entire class;
Public Class LinkMAN_TextBox
Inherits System.Windows.Forms.TextBox
Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
Dim drawBrush As New SolidBrush(Me.ForeColor)
e.Graphics.DrawString(Me.Text, Me.Font, drawBrush, 0.0F, 0.0F)
End Sub
Public Sub New()
MyBase.New()
Me.SetStyle(ControlStyles.UserPaint, True)
End Sub
End Class
I suspect this may be a bug, but if anyone can help I'd appreciate it.
Thanks,
Graham
- Next message: Cablewizard: "Re: converting int to char"
- Previous message: The Grim Reaper: "Re: Tooltips"
- Next in thread: Ken Tucker [MVP]: "Re: New problem with User control...derived class.."
- Reply: Ken Tucker [MVP]: "Re: New problem with User control...derived class.."
- Reply: Mick Doherty: "Re: New problem with User control...derived class.."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|