C# WinForm takes times for Initializecomponent()

1.1k Views Asked by At

I am working on C# application where i am using "Telerik" controls to design the form. I have 5 tabs in Ribbon control having around 15 controls in each tab. The main problem arise when i run the code. It takes some time to load all the controls, it shows grey screen until controls loaded completely. The problem is with InitializeComponent() which is taking time. So is there any solution(s) which i can use so that my designer can load fast and i can avoid slow load of designer. I can't upload full code. But i can give some idea how i have designed.

RadRibbonBar myRibbon;//ribbon control
this.myRibbon.CommandTabs.AddRange(new Telerik.WinControls.RadItem[] {
            this.rbnTab1,
            this.rbnTab2,
            this.rbnTab3,
            this.rbnTab4,
            this.rbnTab5});//add tabs

 this.rbnTab1.Items.AddRange(new Telerik.WinControls.RadItem[] {
            this.rbngroup1,
            this.rbngroup2,
            this.rbngroup3,
            this.rbngroup4});//add groups in tab

 this.rbngroup1.Items.AddRange(new Telerik.WinControls.RadItem[] {
            this.rbnBtn1,
            this.rbnBtn2,
            this.rbnBtn3,
            this.rbnBtn4});//add button in each group

myRibbon.ThemeName = "Office2013Light";

Each tab with 5 groups, each group with 4 button

Apart from this 15 buttons in StartMenu, around 10 controls in QuickAccessToolBar

NOTE: I am adding ribbon control in SplitContainer, and when i add ribbon from designer it takes entire screen to load slow whereas if i load ribbon at the end of window_load event than first it shows remaining controls and than its usual time to show ribbon.

0

There are 0 best solutions below