By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,464 Members | 1,609 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,464 IT Pros & Developers. It's quick & easy.

Speed up TabControl ?

P: n/a
Hi,

Just an idle query. I've been speed profiling some code and the following
two calls seem relatively expensive, especially if you're adding a few tabs
:
this.Tab.TabPages.Clear();

this.Tab.TabPages.Add(tabpage);

Just wondered if there was anyway of saying to the tab control "don't bother
updating until I've done making changes" - had a search in the newsgroups
but didn't find anything, and the member list didn't seem to point to
anything either.

TVMIA,

Adam.

==========================
Ad*********@NOSPAMTHANKS.omnibus.co.uk
Omnibus Systems.
May 17 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi

Take a look at Suspend/ResumeLayout methods

also consider AddRange instead of Add when adding several pages ( not sure
if this will improve performance though )
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Adam Benson" <Ad*********@NOSPAMMYSPAM.omnibus.co.uk> wrote in message
news:ew**************@TK2MSFTNGP03.phx.gbl...
Hi,

Just an idle query. I've been speed profiling some code and the following
two calls seem relatively expensive, especially if you're adding a few
tabs :
this.Tab.TabPages.Clear();

this.Tab.TabPages.Add(tabpage);

Just wondered if there was anyway of saying to the tab control "don't
bother updating until I've done making changes" - had a search in the
newsgroups but didn't find anything, and the member list didn't seem to
point to anything either.

TVMIA,

Adam.

==========================
Ad*********@NOSPAMTHANKS.omnibus.co.uk
Omnibus Systems.

May 17 '06 #2

P: n/a
you can call addrange instead of add.
just for curiousity how many tabpages are you adding that it starts to take
so much performance?

--

"Adam Benson" <Ad*********@NOSPAMMYSPAM.omnibus.co.uk> schrieb im
Newsbeitrag news:ew**************@TK2MSFTNGP03.phx.gbl...
Hi,

Just an idle query. I've been speed profiling some code and the following
two calls seem relatively expensive, especially if you're adding a few
tabs :
this.Tab.TabPages.Clear();

this.Tab.TabPages.Add(tabpage);

Just wondered if there was anyway of saying to the tab control "don't
bother updating until I've done making changes" - had a search in the
newsgroups but didn't find anything, and the member list didn't seem to
point to anything either.

TVMIA,

Adam.

==========================
Ad*********@NOSPAMTHANKS.omnibus.co.uk
Omnibus Systems.

May 17 '06 #3

P: n/a
Well, it's not many (about 8) but when it happens I need to make it as quick
as possible, so I'm just being obsessive about shaving off performance hits
whereever I can for this particular piece of functionality.

Thanks for the reply.

AB

"cody" <de********@gmx.de> wrote in message
news:Om**************@TK2MSFTNGP03.phx.gbl...
you can call addrange instead of add.
just for curiousity how many tabpages are you adding that it starts to
take so much performance?

--

"Adam Benson" <Ad*********@NOSPAMMYSPAM.omnibus.co.uk> schrieb im
Newsbeitrag news:ew**************@TK2MSFTNGP03.phx.gbl...
Hi,

Just an idle query. I've been speed profiling some code and the following
two calls seem relatively expensive, especially if you're adding a few
tabs :
this.Tab.TabPages.Clear();

this.Tab.TabPages.Add(tabpage);

Just wondered if there was anyway of saying to the tab control "don't
bother updating until I've done making changes" - had a search in the
newsgroups but didn't find anything, and the member list didn't seem to
point to anything either.

TVMIA,

Adam.

==========================
Ad*********@NOSPAMTHANKS.omnibus.co.uk
Omnibus Systems.


May 18 '06 #4

P: n/a
Suspend \ Resume layout helped.

Thanks for the pointer :-)

AB
=====
May 18 '06 #5

P: n/a
Thanks, Ignacio and cody.

Those replies pointed me in the right direction.

Cheers,

Adam.
=====
May 19 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.