Thread: Flickering textbox

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    32

    Flickering textbox

    Can I do something about flickering?? I use, in C#, a TextBox control with its associated Graphics object.
    I'm just using DrawLines & Drawline and Clear methods.
    Maybe use APIs?? I tried that, but when trying to retrieve the HDC of the Graphics object I'm getting some runtime error saying "object already in use";

    Please help.

    thanks. helix

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >> I use, in C#, a TextBox control with its associated Graphics object.<<

    Then please direct your c# questions to the c# board.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    470
    I don't think this is C# specific so I'll try to answer it. Your parent window of the edit box is probably not set to clip children and siblings. The winapi styles for doing this are WS_CLIPSIBLINGS | WS_CLIPCHILDREN

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    I believe you want to have WS_CLIPSIBLINGS and WS_CLIPCHILDREN so those areas aren't drawn to by multiple windows.

    Here is a GDI article on flicker-free drawing.

    However, using WS_CLIPSIBLINGS and WS_CLIPCHILDREN may eliminate the flicker all together.

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 04-02-2009, 04:40 AM
  2. Replies: 5
    Last Post: 03-02-2009, 08:33 AM
  3. Problem with a multiline textbox
    By Zeokat in forum C# Programming
    Replies: 4
    Last Post: 10-24-2008, 01:14 PM
  4. inserting text in a textbox
    By Rune Hunter in forum C# Programming
    Replies: 1
    Last Post: 01-07-2006, 05:32 PM
  5. How would I add a textbox?
    By -KEN- in forum C# Programming
    Replies: 2
    Last Post: 11-13-2001, 02:02 PM