PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Outlook Navigation Bar - With Design-time support and custom Renderers-VBForums
Results 1 to 7 of 7

Thread: Outlook Navigation Bar - With Design-time support and custom Renderers

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Outlook Navigation Bar - With Design-time support and custom Renderers

    Hi,

    I have always wanted to create an Outlook style navigation bar but never really got around to doing it. Recently I found this excellent project by someone called Star Vega. I've not been able to contact him, so if you happen to read this: thanks!

    I used the control I linked to as a 'template' for my control. It has no design-time editing, and does not show different panels so you need to handle that all yourself. I mainly used the drawing code of that control and then built a completely new control from that.

    My control does give you a rich design-time experience. When you add a button, it automatically adds a panel above the buttons to which you can add any control you like during design-time. You can click the buttons (during design-time too) and the corresponding panel will be shown. So it behaves more or less like a TabControl, except that it looks quite different.




    As you can see the OutlookBar can draw itself in different ways. It has a RendererPreset property which you can set to Office2003Blue or Office2007Blue, which are the two styles shown in screenshot above.
    However, that is not all. You can completely customize the OutlookBar in two ways:
    (1) By creating a custom OutlookBarRenderer
    (2) By creating a custom Office2003ColorTable or Office2007ColorTable.

    Option (1) gives you complete control on drawing everything.
    Option (2) gives you the option of only changing the colors that an Office2003 or Office2007 style renderer uses. This is a much easier approach if you want some minor customization, but it is also limited because you cannot change shapes / sizes of anything (use option 1 for that!).

    Click the links for a guide on how to do this.



    When the dropdown icon is clicked, a ContextMenuStrip is shown with some options, such as the Navigation Pane Options window:



    By the way, the ContextMenuStripRenderer property allows you to specify a custom ToolStripRenderer for this context menu so you can match its looks to the correct color scheme if you want.



    I think that is about it. I invite you to take a look at the source. It's not littered with comments, but the more difficult parts have some clarifying comments in them. Also, all objects are in their own namespace. Controls are in the OutlookBarLibrary.Controls namespace, Renderers in the Renderers namespace, etc, so it should all be easy to find.

    I have not had an awful lot of time to debug this so I'm sure there are some bugs. If you find any, please report them in this thread and I'll see if I can take care of them.

    VS2005 users: the project is a VS2008 project so you won't be able to open it (I think). You could try to add the files to a new (Windows Forms Control Library) project manually, but I think I may have used some VS2008-only stuff like Option Infer here and there. If you get any errors you cannot solve yourself, again leave a post here and I'll try to help.


    Usage:
    Download the attached project. Add it to a solution you want to use it in. Build the solution. Find the OutlookBar control in your toolbox and drag it to your form.

    Enjoy!!
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width