Display many child controls in tab page takes toooo long time.

  • Thread starter Thread starter maidaro
  • Start date Start date
M

maidaro

Hi.
First of all, I'm sorry about my poor English.
I have a big problem with tab control.

I write a program which needs many text fields to input data into database.
This application requires so many text fields in a form that my team decides
to separate these text fields into numbers of tab pages, but switching among
the tab pages needs one or two more seconds to display text fields. For
example, one of those pages holds 5 GroupBoxs, and each of them holds 27 text
fields, 1 drop list and 1 check box.

We can reduce the time to an or half second after we set
'UseVisualStyleBackColor' property of TabPage to 'false' and change
'BackColor' property of GroupBox from 'Transparent' to 'Control'. The
problem, however, is that during the switcing of tab pages users can notify
that new selected page draws its child controls from bottom to top. Can I
hide this so that new switched tab page appears only after every child
controls are drawn just like using back surface buffer of DirectX.

Setting double-buffering style of windows form control doesn't affect.
 
Hi,
I have one suggestion.You can use lazy initialization during form load.I
would suggest you can few controls in first tab page and load only first tab
page during form load.And start timer with interval of say 500 milliseconds
in form load.In Function called in timer load controls in remaining tab pages
and thereafter stop timer.This is called lazy initialization.In this way you
will load tab control faster and meanwile in background other tab pages will
be loaded with controls.
 
Thanks for your reply, but I failed to understand what exatly problem is.
The problem is that when windows form control has a lot of controls, it take
so much time to draw it's child controls from bottom to top that I can notice
that.
The time for loading isn't issue.

I found an answer from
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2044742&SiteID=1, but
it was useless, because Enabling WS_EX_COMPOSITED ex-style bit causes 100%
cpu load.

When I wrote another program like this which has tab and a lot of child
controls in Mac OSX. There is no flicker problem.

I tried to solve this problem for the months, but in my though it is time I
should give up. There may be two solution. One is drawing all child controls
on my own in paint handler if it is possible, and the other is switching to
WPF.

Regards.
 
Thanks for your reply, but I failed to make you understand what exatly
problem is.
The problem is that when windows form control has a lot of controls, it take
so much time to draw it's child controls from bottom to top that I can notice
that.
The time for loading isn't issue.

I found an answer from
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2044742&SiteID=1, but
it was useless, because Enabling WS_EX_COMPOSITED ex-style bit causes 100%
cpu load.

When I wrote another program like this which has tab and a lot of child
controls in Mac OSX. There is no flicker problem.

I tried to solve this problem for the months, but in my though it is time I
should give up. There may be two solution. One is drawing all child controls
on my own in paint handler if it is possible, and the other is switching to
WPF.

Regards.
 
Back
Top