Results 1 to 15 of 15

Thread: [RESOLVED] [2008] Override OnPaint of a Textbox and a Button

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Lasering's Avatar
    Join Date
    May 2006
    Location
    Lisboa
    Posts
    559

    Resolved [RESOLVED] [2008] Override OnPaint of a Textbox and a Button

    Hi!!

    In the Attachment I have a project very simple, just a form and a two classes: the TestTB and the TestB. The testTB class Inherits from the TextBox class and the TestB Inherits from the Button class. And the only sub that they have is this one:
    Code:
        Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
            MyBase.OnPaint(e)
            e.Graphics.DrawString("1", Me.Font, New SolidBrush(Me.ForeColor), 3, 1)
            e.Graphics.DrawString("2", Me.Font, New SolidBrush(Me.ForeColor), 13, 1)
            e.Graphics.DrawString("3", Me.Font, New SolidBrush(Me.ForeColor), 23, 1)
            e.Graphics.DrawString("4", Me.Font, New SolidBrush(Me.ForeColor), 3, 13)
            e.Graphics.DrawString("5", Me.Font, New SolidBrush(Me.ForeColor), 13, 13)
            e.Graphics.DrawString("6", Me.Font, New SolidBrush(Me.ForeColor), 23, 13)
            e.Graphics.DrawString("7", Me.Font, New SolidBrush(Me.ForeColor), 3, 25)
            e.Graphics.DrawString("8", Me.Font, New SolidBrush(Me.ForeColor), 13, 25)
            e.Graphics.DrawString("9", Me.Font, New SolidBrush(Me.ForeColor), 23, 25)
        End Sub
    In the form i have a TestTB control and a TestB control. Now my question is why in hell doesn't the TestTB control shows the little numbers like the TestB control??
    Attached Files Attached Files
    Last edited by Lasering; Sep 7th, 2008 at 03:24 PM.
    Controls: XPCC|Quantum
    Windows API'sLINQ to XML SamplesRegex Tutorial

    Albert Einstein:
    "Imagination is more important than knowledge."
    "Everything should be made as simple as possible, but not simpler."
    "Great spirits have often encountered violent opposition from weak minds."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width