Results 1 to 40 of 64

Thread: 100% Customizable MenuStrip / ToolStrip / StatusStrip, including common presets

Threaded View

  1. #1

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

    100% Customizable MenuStrip / ToolStrip / StatusStrip, including common presets

    EDIT 4 - Added CustomizableBindingNavigator
    - Added Office2007Black preset style
    Thanks to dherr!

    EDIT 3 - Added CustomizableToolStripPanel as a separate file (too lazy to zip it up again )

    EDIT 2 - Added CustomizableContextMenuStrip as a separate file (too lazy to zip it up again )


    EDIT - New version.
    New in this version:
    - Appearance Editor window
    - Loading and Saving appearances to XML files
    - StatusStrip colors added
    - Few minor bug fixes

    ---------------


    Hey all,


    This is a completely new version of my old Customizable ToolStrip codebank submission, taking care of the problem of having to customize each Menu/ToolStrip separately.


    In this release, there are six controls, one form, and one component (and one other class):
    • CustomizableMenuStrip
    • CustomizableToolStrip
    • CustomizableStatusStrip
    • CustomizableContextMenuStrip
    • CustomizableToolStripPanel
    • CustomizableBindingNavigator
    • AppearanceControl
    • frmAppearanceEditor
    • CustomAppearancePropertyEditor

    (Because I can only upload 5 files, I had to zip them. The zip file contains all the files you need, just add them to a new or existing VB.NET project and build it)

    The CustomizableMenuStrip, CustomizableToolStrip, CustomizableStatusStrip and CustomizableContextMenuStrip (after this called 'Strips' for short) aren't very exciting. The only real difference is that they all have a new property called Appearance. This is where the AppearanceControl comes into play.

    The CustomAppearancePropertyEditor is a UITypeEditor that takes care of showing the frmAppearanceEditor form.

    The AppearanceControl is a component (I named it control because it controls the appearance, sorry for confusion), which means it sits in the component tray (just like the ToolTip component for example) and has no visual representation on the form.

    The AppearanceControl has a large number of properties that allow you to completely control the look of any of the three Strips. There is a property for each possible color, so you can choose whatever you like.
    New: These properties are now accessible via the CustomAppearance property. Click the [...] button next to it in the properties list and the Appearance Editor window will open.

    As said, each of the three Strips have an Appearance property. You assign an instance of the AppearanceControl component to that property (usually you would have one AppearanceControl, and have many Strips using that one component). The Strips will then use the colors as defined in the AppearanceControl.

    This way, you can use a single AppearanceControl to control the colors of as many (Context)MenuStrips, ToolStrips and now even StatusStrips that you like. Obviously, each will have the exact same colors. If you need your MenuStrip to have different colors then your ToolStrip, you simply use two AppearanceControl components, and assign one to the MenuStrip and the other to the ToolStrip.


    Here are some screenshots:

    A completely custom red style.


    Form showing two different styles at the same time.


    Screenshot of the new Appearance Editor window.

    In the last screenshot you can also see the Load and Save buttons which allow you to load and save any custom appearance to an XML file. This way you can also exchange cool appearances with others (for example, in this thread!).

    Finally, as a bonus, you get 6 presets which you can simply select. They are shown in the following screenshot in this order:
    • Office 2007 (Blue)
    • Office 2007 (Black) (not shown in image)
    • Office 2003 (Blue) (default on XP blue)
    • Office 2003 (Olive) (default on XP olive)
    • Office 2003 (Silver) (default on XP silver)
    • Office XP (default on Vista/Win7)
    • Office Classic (default on classic style)



    So you no longer have to deal with the colors that the users theme gives you. With this, you can always use the blue Office 2003 theme (which is usually only available automatically on the blue XP theme), even on Vista or Windows 7 or on different themes.

    To select a preset you simply select on from the list in the Preset property.


    Oh, I almost forgot, the CustomizableToolStrip also exposes the RoundedEdges property to allow you to disable the rounded edges (thanks the JuggaloBrotha for reminding me and thanks to Deepak Sakpal for bringing it to everyones attention


    I still have a few ideas left to implement:
    • Design time Editor window - DONE
    • Loading / saving customizations - DONE
    • More presets

    But they will have to wait until I find time

    For now, enjoy them!





    To use:
    If you downloaded the separate files zip, simply add all the files to your project (possibly a new class library).
    If you downloaded the control library project zip, just open the project.

    Build the project, and find them at the top of your Toolbox!

    Drag an AppearanceControl to the form. Then drag any of the Strips to the form, and set their Appearance property to that AppearanceControl. Then use the Customizable[Menu/Tool/Status]Strip controls as you usually would.
    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
  •  



Click Here to Expand Forum to Full Width