SuspendLayout is not working?

P

Pipo

Hi,

During run-time I change the layout of my wondows forms.
The problem is you can see the changing when it happens.
I change some grids in a groupbox (grbRates).
So I do the SuspendLayout() and ResumeLayout when it is done.
That is not working, I read the MSDN and it says this should work.
What am I doing wrong? I use VS 2005, C# 2.0

tia.

Code snippet in an SelectedIndexChange event:

grbRates.SuspendLayout();
if (grbInquiry.Visible)
{
//Set screen.
dgvRatesSelling.Dock = DockStyle.None;
dgvRatesSelling.Width = dgvRatesBuying.Width;
dgvRatesSelling.Anchor = dgvRatesBuying.Anchor;
dgvRatesBuying.Visible = true;
}
else
{
//Default screen.
dgvRatesSelling.Dock = DockStyle.Fill;
dgvRatesBuying.Visible = false;
}
grbRates.ResumeLayout();
 

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