473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Speed up TabControl ?

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
5 1840
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
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
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
Suspend \ Resume layout helped.

Thanks for the pointer :-)

AB
=====
May 18 '06 #5
Thanks, Ignacio and cody.

Those replies pointed me in the right direction.

Cheers,

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tamir Khason | last post by:
How be able to manage more deeply UI of TabControl and TabPage For example - I want to manage border color, change color of TabPage reef, eliminate spaces from both sides of the reef, so I bould...
2
by: Patrick McGuire | last post by:
I want to place a tabControl with almost identical properties on several forms. I think the best way is to define a UserControl that inherits System.Windows.Forms.TabControl, and place all my...
9
by: Michael Turner | last post by:
Hi Guys Having problem with the tab control, I need to set the background color to something different than the standard, I have found code on the web and now can redraw the tabpage buttons so...
5
by: Zadkin | last post by:
Does anyone know, if it's possible to set the orientation of the tabpagebuttons to horizontal instead of vertical when the alignment property of my tabcontrol is set to left or right? Thanks in...
1
by: =?Utf-8?B?QWxleCBLLg==?= | last post by:
Hi all In a Visual Studio 2005 C# project, I have a simplest tabcontrol with two tabpages. When I set tab control's Alignment property to Right, tab texts (captions) disappear. Does anybody...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.