Form Flickering when clicking tabcontrol

G

Guest

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

Emma Middlebrook

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?
 
E

Emma Middlebrook

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
 
G

Guest

Dear Emma,

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

Emma Middlebrook

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top