Tab text alignment

Topics related to the Krypton Navigator.

Moderators: Phil Wright, Chris Porter

Tab text alignment

Postby dean1012 » Thu May 08, 2008 6:14 am

So, i've solved all my other problems. This one, however, has me stumped.

I have a set of sideways tabs (in the attached picture, all the way to the right). Each tab has an image and text.

I have it set to be same width and height. I've tried everything I could think of, but the tab text/image are center aligned. I need them left aligned - like in the subpages of the onenote demo.

Anyone have a suggestion?

The navigator is made programmatically, BTW.

The code for creating the navigator is:

(i removed all my attempts at fixing it, since none of it changed anything)

Code: Select all
            KryptonPage containerPage = new KryptonPage();
            containerPage.UniqueName = this.GUID;

            KryptonNavigator pageList = new KryptonNavigator();
            pageList.Name = "pageList";
            pageList.Bar.BarOrientation = VisualOrientation.Right;
            pageList.Bar.ItemOrientation = ButtonOrientation.FixedTop;
            pageList.Bar.ItemSizing = BarItemSizing.SameWidthAndHeight;
            pageList.Bar.TabBorderStyle = TabBorderStyle.RoundedEqualSmall;
            pageList.Bar.TabStyle = TabStyle.HighProfile;
           
            pageList.Button.ButtonDisplayLogic = ButtonDisplayLogic.NextPrevious;
            pageList.Button.CloseButtonDisplay = ButtonDisplay.Hide;
            pageList.Dock = DockStyle.Fill;
            pageList.NavigatorMode = NavigatorMode.BarRibbonTabGroup;
            pageList.SelectedPageChanged += new EventHandler(pageList_SelectedPageChanged);
            pageList.Pages.Inserted += new TypedHandler<KryptonPage>(pageList_Inserted);

            containerPage.Controls.Add(pageList);


The navigator you see in the screenshot on the right is pageList. It is added to a container page, because that is then added to another, hidden navigator.

The code to create a new page tab on the navigator is this:

Code: Select all
                    KryptonPage temp = new KryptonPage();
                    temp.Text = pd.getTitle().Trim();
                    temp.ImageSmall = global::Notepad_.Properties.Resources.document_notebook;
                    temp.UniqueName = System.Guid.NewGuid().ToString("N");

                    KryptonRichTextBox tempb = new KryptonRichTextBox();
                    tempb.AcceptsTab = true;
                    tempb.Multiline = true;
                    tempb.DetectUrls = true;
                    tempb.WordWrap = true;

                    tempb.Dock = DockStyle.Fill;

                    temp.Controls.Add(tempb);



I've left out some code, of course, but I believe i've included anything necessary.

If you have any idea for what to try, please suggest it.

Image

Thank you
dean1012
 
Posts: 17
Joined: Sat May 03, 2008 1:11 am

Postby Phil Wright » Thu May 08, 2008 2:35 pm

Simple enough, just set the text and image alignment on the tabs...

pageList.StateCommon.Tab.Content.Image.ImageH = PaletteRelativeAlign.Near;
pageList.StateCommon.Tab.Content.ShortText.TextH = PaletteRelativeAlign.Near;
Phil Wright
Site Admin
 
Posts: 2720
Joined: Thu Apr 13, 2006 2:55 pm
Location: Melbourne, Australia

hmm

Postby dean1012 » Thu May 08, 2008 4:43 pm

Actually, it started working once I stopped using the NavigatorMode ribbon. Must be something with ribbon mode.

I'm happy with how it turned out though - so no big deal.

Thanks for being so patient with me! I seem to keep answering my own problems as soon as I post them :(

Now i'm on the search for a slider (track bar) that looks good with Krypton. I noticed Krypton did not have one and the windows default one looks horrible with the awesome UI toolkit.
dean1012
 
Posts: 17
Joined: Sat May 03, 2008 1:11 am


Return to Krypton Navigator

Who is online

Users browsing this forum: No registered users and 0 guests

cron