Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic When to use OnLayout event and How?? (Read 1743 times)
Erison Liang
Guest


When to use OnLayout event and How??
Jan 18th, 2006 at 7:58pm
Print Post  
Hi,

Could you please provide an example? Thanks.

- Erison
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: When to use OnLayout event and How??
Reply #1 - Jan 19th, 2006 at 6:55am
Print Post  
OnLayout is an event of the Control class related to laying out the controls on a form. You could use the Progress delegate to track the progress of a layout algorithm, e.g.

Code
Select All
GridLayout gl = new GridLayout();
gl.Iterations = 20000;
gl.Progress = new LayoutProgress(onProgress);
gl.Arrange(fc);

void onProgress(int c, int n)
{
  label1.Text = (100*c/n).ToString() + "% complete";
  label1.Refresh();
}
 

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint