New problem with User control...derived class..

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Graham Blandford (graham.blandford_at_sympatico.ca)
Date: 07/14/04


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



Relevant Pages

  • Re: For Rabbit and Pam
    ... I've never seen a book printed in a sans serif font but I would imagine ... Folks - all your words are sinking in, maybe only slowly, but they are ...
    (uk.people.silversurfers)
  • Re: Panic.com new software
    ... I LOVE the fact that the editor comes with its own font, Panic Sans, which is really easy on the eye, and available as a dfont file within the application. ... Email steve 'at' shodgson 'dot' org 'dot' uk ...
    (uk.comp.sys.mac)
  • Re: PostScript fonts in MsOffice 2007
    ... Sans - OpenType. ... stipulation of the request for improving the company font, ... I am not sure that what you are seeing is a "bug" in the strict sense. ... That version does _not_ have Cyrillic glyphs and if it is being ...
    (microsoft.public.word.printingfonts)
  • Re: Choosing fonts?
    ... Equally I want a simple life and a Sans Serif font that will let me ... Any good TeX distribution will provide Computer Modern Sans, ...
    (comp.text.tex)
  • Re: Strange characters in "make xconfig"
    ... Bob Chiodini escribió: ... >set to Luxi Sans and it seems to work. ... and xconfig was showing the font "Standard symbols". ... font "Standard symbols" and now xconfig is displayed using "Sans". ...
    (Fedora)