Results 1 to 5 of 5

Thread: OnPaint not firing

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    Resolved OnPaint not firing

    I've created an inherited textbox control...i've overriden the OnPaint method. Ive put a break there and it never gets hit. what could the problem be?

    exactly when does the Paint event happen?
    Last edited by Andy; Jun 28th, 2005 at 08:52 AM.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: OnPaint not firing

    call this in the constructor (new method)

    setstyle(ControlStyles.UserPaint)

    although sometimes it can have undesirable results as it requires you to paint everything..

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    Re: OnPaint not firing

    cool. i'll give that a shot. What kind of side effects are you talking about?

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    Re: OnPaint not firing

    worked like a charm! thanks a bunch

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: OnPaint not firing

    Quote Originally Posted by Andy
    cool. i'll give that a shot. What kind of side effects are you talking about?
    not sure if any in the textbox, but in another thread the other day we were messing around with it with a listview to try to gradient the background, and when using it, it forces you to have to write all the code to draw the listview items as well as the background... it basically puts all painting in your hands.

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