Form Flickering when clicking tabcontrol

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I freeze my form till all controls (data) is loaded to avoid form
flickering when clicking (select) a tab
 
How can I freeze my form till all controls (data) is loaded to avoid form
flickering when clicking (select) a tab

Have you tried calling SuspendLayout on them and then ResumeLayout?
 
yep, i've tried them without success, any other suggestions??

I've had something similar in the last week where I was getting a
flicker when resizing the container form in some of my treeview
controls. What I did was override ResizeBegin and then explicitly call
BeginUpdate on the controls that were causing the flicker and also
override ResizeEnd and explicitly call EndUpdate to get them to combat
this problem.

I'm not sure if you could take this technique and apply it in some way
to your loading flicker problems?

Emma
 
Dear Emma,

do you have a code snipped how to use this beginupdate, endupdate functions
Thx for your quick response(s)
 
Dear Emma,

do you have a code snipped how to use this beginupdate, endupdate functions
Thx for your quick response(s)

Hi

Sorry for the late reply:

In the form code file I just added the following to override the
Resize functionality

protected override void OnResizeBegin(EventArgs e)
{
base.OnResizeBegin(e);
FindXXXTreeView().BeginUpdate();
FindXXXXTreeView().BeginUpdate();
}

You then have a normal public function called BeginUpdate() in user
control that has the component in need of flicker management. This
just calls the appropriate call on the control.

public void BeginUpdate()
{
treeViewXXX.BeginUpdate();
}

I'm not sure if you can use this technique for your tab control, it
depends if you can find a suitable method to put it in and then do the
same when it needs to end the update. My problem was with resizing so
I had ResizeBegin and ResizeEnd available to me to use.

Hope that helps,

Emma
 
Back
Top