Connecting Tech Pros Worldwide Forums | Help | Site Map

TabPage Sequence Problem

Sumit
Guest
 
Posts: n/a
#1: Nov 16 '05
Hi all,

I am working on an application in which there is a form which has a
tabcontrol containing 4 tab pages.
Let the name of the tabpages be A,B,C&D.

The default view is that there are all the tabpages(A-D) in the
tabControl.
Now there is a button on TabPage A & when the button is clicked the
default view changes to a tabcontrol having three tabpages A,B & D.
Also again if i click on the same button the TabControl should show all
the 4 tabPages.

So wat i have done is that when their are 4 tabPages & the button is
clicked i have done
TabControl.TabPages.Remove(C);

If their are three tabpages & the button is clicked i have done
TabControl.TabPages.Add(C);

But the problem that i am facing is that the sequence of tabpages is
not proper. It is adding the TabPage C at end( A-B-D-C) but i require
it in between B & D.(A-B-C-D).

Kindly tell me how can i change the sequence of TabPages being
displayed at runtime ??

Warm Regards
Sumit


Cor Ligthert
Guest
 
Posts: n/a
#2: Nov 16 '05

re: TabPage Sequence Problem


Sumit,

A known bug, you have to remove D as well and than add C and D again.

(You only remove the references to the tabcontrol not the tabpages of course
and add those again)

I hope this helps,

Cor


Mick Doherty
Guest
 
Posts: n/a
#3: Nov 16 '05

re: TabPage Sequence Problem


You don't need to remove D just swap C and D. Removing tabpages and then
re-adding, just to insert one, will cause flicker.

See the example on my site:
http://dotnetrix.co.uk/tabcontrols.html --> Hide and Show Tabpages in a
Tabcontrol.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


"Cor Ligthert" <notmyfirstname@planet.nl> wrote in message
news:ugZsHw%23FFHA.348@TK2MSFTNGP09.phx.gbl...[color=blue]
> Sumit,
>
> A known bug, you have to remove D as well and than add C and D again.
>
> (You only remove the references to the tabcontrol not the tabpages of
> course and add those again)
>
> I hope this helps,
>
> Cor
>[/color]


Cor Ligthert
Guest
 
Posts: n/a
#4: Nov 16 '05

re: TabPage Sequence Problem


Mick,

In this case the OP says that he has removed first tabpage C because of his
purpose.
I think that it will not make much difference than and maybe look even more
smooth in this case.

Cor


Mick Doherty
Guest
 
Posts: n/a
#5: Nov 16 '05

re: TabPage Sequence Problem


I'll agree, that in this case, it won't make much difference since there is
only one tabpage to remove before adding one and replacing it, but I would
still recommend swapping over removing and re-adding.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


"Cor Ligthert" <notmyfirstname@planet.nl> wrote in message
news:uxr3Z6AGFHA.560@TK2MSFTNGP15.phx.gbl...[color=blue]
> Mick,
>
> In this case the OP says that he has removed first tabpage C because of
> his purpose.
> I think that it will not make much difference than and maybe look even
> more smooth in this case.
>
> Cor
>[/color]


Closed Thread


Similar C# / C Sharp bytes