Windows Develop Bookmark and Share   
 index > Windows Forms General > SplitContainer Flicker while Resize
 

SplitContainer Flicker while Resize

When i resize the sub panel of split container(programatically), there is a ugly blank(usually on the right side),
i guess it is caused by container background mob.

i searched on internet, there are a few article on this issue, but none of them give a straight solution, i don't
have time to re-create a split-container, but only derived it from System.Window.Forms.SpitterContainer.

i tried override OnPaintBackgound, SetStyle, and WM_ thing, not work.

I am now still working with .Net 2.0, don't know much about 3.0. If there a good solution to at lease reduce the flicker.
Thanks very much.

  • Moved byeryangMSFTMonday, October 05, 2009 8:45 AM (From:.NET Base Class Library)
  •  
tuis_1  Thursday, October 01, 2009 1:41 AM

Every time i put an question on this web site, i could light my idea.
i found a simple way to solve this problem, Ahaha

First Derive Split Container and Override:
private const int WM_ERASEBKGND = 0x0014;

protected override void WndProc(ref Message msg)
{
switch (msg.Msg)
{
case WM_ERASEBKGND:
System.Diagnostics.Debug.WriteLine("Avoided clear bg");
return;
}

base.WndProc(ref msg);
}
Second:
No dock control to SplitContainer's Panel2, Resize the control manually.

I've find this accidentally, got a wonderful result, testing continue...

tuis_1  Thursday, October 01, 2009 1:49 AM

Every time i put an question on this web site, i could light my idea.
i found a simple way to solve this problem, Ahaha

First Derive Split Container and Override:
private const int WM_ERASEBKGND = 0x0014;

protected override void WndProc(ref Message msg)
{
switch (msg.Msg)
{
case WM_ERASEBKGND:
System.Diagnostics.Debug.WriteLine("Avoided clear bg");
return;
}

base.WndProc(ref msg);
}
Second:
No dock control to SplitContainer's Panel2, Resize the control manually.

I've find this accidentally, got a wonderful result, testing continue...

tuis_1  Thursday, October 01, 2009 1:49 AM

I’m glad to hear that you got it working. Thank you for sharing your experience here.

It will be very beneficial for other community members having the similar questions.


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Wednesday, October 07, 2009 11:59 AM

You can use google to search for other answers

Custom Search

More Threads

• Changing folder properties
• Transfer data from data grid to excel
• KeyPress event doesn't work
• Appending RichTextBox Data
• Right-To-Left Alignment in AutoComplete
• C# WinForm application and screen reader(JAWS) issue
• Message Queue.
• Form Opacity Changed -> Component not updating
• Anchor seems not working in SplitterContainer
• Collapsible Panel and Custom Control