简体   繁体   中英

Tablayout panel taking too long time to load

i have below form where i have several controls in Tablayout panel, as show in image.

在此处输入图片说明

its taking too long time(and also flicker) when i load this form.

i tried : i select CellBorderStyle as a 'None' so, that moment i didnt observe this issue, but the moment i choose any cellBorder style apart from 'None' its appears.

PS; i didn't perform any operation while form loading. just trying to load initial form.

Try DoubleBuffered property to avoid flickering. You will have to create a subclass from TableLayoutPanel to set the DoubleBuffered property to true.

Below is Complete answer as Tor suggested .

public static void SetDoubleBuffered(System.Windows.Forms.Control c)
{

    if (System.Windows.Forms.SystemInformation.TerminalServerSession)
        return;

    System.Reflection.PropertyInfo aProp =
          typeof(System.Windows.Forms.Control).GetProperty(
                "DoubleBuffered",
                System.Reflection.BindingFlags.NonPublic |
                System.Reflection.BindingFlags.Instance);

    aProp.SetValue(c, true, null);
}

i called upperfunction from form Constructor

SetDoubleBuffered("tablayoutPanelName");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM