Why DataGridView flickering when use in MDI chilform?

  • Thread starter Thread starter Mohanmj
  • Start date Start date
M

Mohanmj

Guest
I have used the following code avoid the flickering issue issue for my controls but dataGridView alone getting flickering when moving that form inside of the MDI form.

Code

public Form2()
{

InitializeComponent();
this.PreventFlickering();
this.IsMdiContainer = true;
}

protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle = cp.ExStyle | 33554432;
return cp;
}
}

private void PreventFlickering()
{
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.UpdateStyles();
}

private void button1_Click(object sender, EventArgs e)
{
Form3 form = new Form3();
form.MdiParent = this;
form.Show();
}


Please let me know why am i getting this flickering issue. Then, how can i resolve this issue.

Thanks,


Mohanraj G

Continue reading...
 
Back
Top