By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,897 Members | 1,490 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,897 IT Pros & Developers. It's quick & easy.

TreeView flashing when resizing form - but only as a Dialog WHY?

P: n/a
I've seen several posts from people who have seen this flashing in
TreeView's when resizing a form. I've noticed it in my app, but only in the
child windows. For example, my main form has a splitter with a TreeView and
I do not get the flickering with it.

I created a new Form based Windows app. Added a TreeView (dock left), then
a splitter and a property grid on the right (dock fill). For this test, I
added a panel and button at the bottom so I could create the child form.

I created a second form and created it the exact same way - TreeView on the
left, splitter and a property grid on the right. In the click handler for
the button on the first form, I create a new "Form2" and call "ShowDialog"
passing "this" in as a parameter to make the main form the parent for the
dialog.

After adding some nodes to each of the tree views, fire up the app. If you
resize the main form, you won't see flickering in the tree view. Click the
button to show the parent form and resize it - you will see horrible
flickering.

Now, why is that? With the exception of the extra panel to hold the button
on the main form, they are identical, yet the child displayed with
ShowDialog shows terrible flickering.

If I had to guess (which I guess I am guessing right now :-) I'd say
Microsoft was expecting that forms shown with "ShowDialog" would not be made
resizable so they left out paint optimizations when resizing. If that is
the case, how do we get rid of the flickering when resizing a dialog?

Thanks,
Terry

Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I have a little more information about this.

I discovered that the tree flickering only happens on XP when the XP themes
are enabled. If the "Windows classic" style is used, the tree view does not
flicker when the dialog is resized.
"Terry" <ch**********@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP10.phx.gbl...
I've seen several posts from people who have seen this flashing in
TreeView's when resizing a form. I've noticed it in my app, but only in the child windows. For example, my main form has a splitter with a TreeView and I do not get the flickering with it.

I created a new Form based Windows app. Added a TreeView (dock left), then a splitter and a property grid on the right (dock fill). For this test, I
added a panel and button at the bottom so I could create the child form.

I created a second form and created it the exact same way - TreeView on the left, splitter and a property grid on the right. In the click handler for
the button on the first form, I create a new "Form2" and call "ShowDialog"
passing "this" in as a parameter to make the main form the parent for the
dialog.

After adding some nodes to each of the tree views, fire up the app. If you resize the main form, you won't see flickering in the tree view. Click the button to show the parent form and resize it - you will see horrible
flickering.

Now, why is that? With the exception of the extra panel to hold the button on the main form, they are identical, yet the child displayed with
ShowDialog shows terrible flickering.

If I had to guess (which I guess I am guessing right now :-) I'd say
Microsoft was expecting that forms shown with "ShowDialog" would not be made resizable so they left out paint optimizations when resizing. If that is
the case, how do we get rid of the flickering when resizing a dialog?

Thanks,
Terry

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.