display a tab to the right of the tab control

  • Thread starter Thread starter Peter Duniho
  • Start date Start date
P

Peter Duniho

Hi,

I added a tab control to my form. I need to add the tab pages to the
control at run-time. But this is little different from the normal way.
I need to display one specific tab to the right most, while the other
tabs can be from left to right. Do I need to inherit the control and
specify the location for the specific tab? Please suggest how to do
this??

You should be able to accomplish what you want simply by ensuring that
the tab that needs to be right-most is always the last TabPage instance
in the TabControl.TabPages collection.

Pete
 
Hi,

I added a tab control to my form. I need to add the tab pages to the
control at run-time. But this is little different from the normal way.
I need to display one specific tab to the right most, while the other
tabs can be from left to right. Do I need to inherit the control and
specify the location for the specific tab? Please suggest how to do
this??

Thanks,
Hari
 
You should be able to accomplish what you want simply by ensuring that
the tab that needs to be right-most is always the last TabPage instance
in the TabControl.TabPages collection.

Pete

Hi Peter,

Following is what exactly I want.

As the tabs get added at run-time they are added in the normal way
left-to-right. But one specific tab should look like the first tab
when added from right-to-left. For eg, if there are totally 3 tabs on
the control, two should appear from left, one should appear on the
right. Please suggest.

Thanks,
Hari.
 
As the tabs get added at run-time they are added in the normal way
left-to-right. But one specific tab should look like the first tab
when added from right-to-left. For eg, if there are totally 3 tabs on
the control, two should appear from left, one should appear on the
right. Please suggest.

What about my suggestion have you tried, but not been able to use to get
what you want? What exactly are you having trouble with?

Pete
 
What about my suggestion have you tried, but not been able to use to get
what you want? What exactly are you having trouble with?

Pete

Hi Peter,

Yes, I tried the one you suggested. If I have only 3 tabs the 3rd
tab(tabs heading) is displayed at the middle of the tab control, not
to its right. But what I want is two tabs to be drawn from left-to-
right(normal) and the other tab to look like one which id drawn from
right-to-left.So there should be a space between the first two tabs
and the 3rd tab. Please suggest on the same.

Thanks,
Hari.
 
Yes, I tried the one you suggested. If I have only 3 tabs the 3rd
tab(tabs heading) is displayed at the middle of the tab control, not
to its right. But what I want is two tabs to be drawn from left-to-
right(normal) and the other tab to look like one which id drawn from
right-to-left.So there should be a space between the first two tabs
and the 3rd tab. Please suggest on the same.

I think I am beginning to understand your request. You are not asking
how to control the order of the tabs. You actually want the tab itself,
of the last tab in the group of tabs, to be aligned flush to the right
of the entire tab control, while the other tabs are drawn normally,
flush to the left.

Is that correct?

If so, I'm afraid you may have to write your own tab control. I don't
think the built-in TabControl supports that.

I did notice this article:
http://msdn2.microsoft.com/en-us/library/ms404305.aspx

I haven't done this myself, so I can't offer specific advice. But I
think it's possible, based on what I've seen in that article, that you
could set the TabControl to "owner draw" and handle just the drawing of
the tabs yourself. If so, then you could always draw the last tab flush
to the right.

Sorry I wasn't of more help. Hopefully the above gets you where you want.

Pete
 
Back
Top