开发者

WinForm InitializeComponent Performance

开发者 https://www.devze.com 2023-03-02 15:56 出处:网络
I have a WinForm application that has 700 individual items (combo boxes, grids, text boxes, etc.). There are twelve tabs with a grid on each tab and then text boxes for data entry. All of the data nee

I have a WinForm application that has 700 individual items (combo boxes, grids, text boxes, etc.). There are twelve tabs with a grid on each tab and then text boxes for data entry. All of the data needs to be on this form. I've suggested splitting into individual components and the owner stating that this is what is wanted.

With no database calls, just loading the form, takes 17 seconds. Is there a way to improve the lo开发者_StackOverflow社区ad time?


Delay-Loading.

Add your first tab, then add 11 blank TabPages (each with the proper name). The TabControl will look the same.

Then on each firing of OnAppIdle, replace one blank TabPage with the real one.

You will additionally need to handle OnTabPageSelected in case the user picks a tab you haven't yet delay loaded.

--

I have code to show when I get back to a computer with my source.

0

精彩评论

暂无评论...
验证码 换一张
取 消