-
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
-
>> I use, in C#, a TextBox control with its associated Graphics object.<<
Then please direct your c# questions to the c# board.
-
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
-
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