Page 1 of 2 12 LastLast
Results 1 to 40 of 64

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

  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

  2. #2
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

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

    Very nice, I like how you made it so the three controls reference the Appearance control so 1 setting changes all three on the form.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  3. #3

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

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

    I updated the first post with some new stuff and updated the files.

    New in this version:
    - Appearance Editor window with a real-time preview of the appearance.
    - Ability to load and save appearances to an XML file (also in the editor window).

    Bug fixes:
    - Strips will now revert to default renderer (and colors) when their Appearance property is changed back to (none).
    - When an AppearanceControl (in use by a Strip) is removed from the form, all Strips using it will change their Appearance property back to (none), instead of throwing null reference exceptions.

  4. #4
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

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

    very nice, the only suggestion I have is to have the dialog be sizable so it can be made taller to show more properties on the screen at once.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  5. #5

  6. #6
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

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

    Quote Originally Posted by NickThissen View Post
    Well, you have to source so you can add that yourself
    I'll add it in a later version though if I ever make another update.
    I did before posting
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  7. #7

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

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

    I completely forgot about the ContextMenuStrip! I've now also added a CustomizableContextMenuStrip that works in just the same way as the other strips. I couldn't be bothered to re-zip and re-upload the files so I just added it separately.

  8. #8
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

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

    I like the ContextMenuStrip, I'd forgotten about it too.

    Also with the ToolStrip I noticed that the RoundedEdges wasn't working at all when a Preset was selected so I went ahead and fixed it:
    Code:
        Public Property RoundedEdges() As Boolean
            Get
                Return _RoundedEdges
            End Get
            Set(ByVal value As Boolean)
                If _RoundedEdges <> value Then
                    _RoundedEdges = value
                    CType(Me.Renderer, ToolStripProfessionalRenderer).RoundedEdges = _RoundedEdges
                    Me.Invalidate()
                End If
            End Set
        End Property
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  9. #9
    Lively Member
    Join Date
    Nov 2004
    Posts
    98

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

    Hi folks, hopefully someone is still following this thread. This is an awesomely useful tool - and I'm trying to apply it to another control, namely ToolStripPanel (to hold toolstrips, in my case in an MDI app) because it seems at the moment - this was designed for toolstrips that aren't inside a container (i.e. not docked to "top").

    I used the CustomizableMenuStrip class as a starting point, as normally the container that holds a toolstrip underneath a menustrip has the same gradient, and then has it's toolstrip(s) inside that container, auto-sized rather than docked to fill the width of the window. Anyway, I muddled my way through creating the class - got a working control that inherited from ToolStripPanel - and then set up what I thought was needed in the AppearanceControl.vb file.

    Anyway, my fiddling created a node and gradient properties for ToolStripPanel in the CustomAppearance designer, but I've not been able to get the control to change appearance - it continues to default to a standard XP/Office 2003 blue gradient.

    Does anyone have any pointers? I've probably just overlooked a step, as dabbling in custom controls and renderers is a bit of new ground for me. Thanks!

  10. #10

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

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

    The AppearanceControl already has two properties for the ToolStripPanel: ToolStripAppearance.PanelGradientBegin and ToolStripAppearance.PanelGradientEnd.

    You don't need to change anything in the AppearanceControl at all. All you need to do is add a new CustomizableToolStripPanel class. You can copy the code exactly from the CustomizableToolStrip class:
    vb.net Code:
    1. Public Class CustomizableToolStripPanel
    2.     Inherits ToolStripPanel
    3.  
    4.     Public Event AppearanceControlChanged As EventHandler
    5.  
    6.     Public Sub New()
    7.         MyBase.New()
    8.         Me.RoundedEdges = True
    9.     End Sub
    10.  
    11.     Private _Appearance As AppearanceControl
    12.     Public Property Appearance() As AppearanceControl
    13.         Get
    14.             Return _Appearance
    15.         End Get
    16.         Set(ByVal value As AppearanceControl)
    17.             _Appearance = value
    18.             If value IsNot Nothing Then
    19.                 Me.Renderer = value.Renderer
    20.             End If
    21.             Me.Invalidate()
    22.             Me.OnAppearanceControlChanged(EventArgs.Empty)
    23.         End Set
    24.     End Property
    25.  
    26.     Private _RoundedEdges As Boolean
    27.     Public Property RoundedEdges() As Boolean
    28.         Get
    29.             Return _RoundedEdges
    30.         End Get
    31.         Set(ByVal value As Boolean)
    32.             If _RoundedEdges <> value Then
    33.                 _RoundedEdges = value
    34.                 CType(Me.Renderer, ToolStripProfessionalRenderer).RoundedEdges = _RoundedEdges
    35.                 Me.Invalidate()
    36.             End If
    37.         End Set
    38.     End Property
    39.  
    40.     Protected Overridable Sub OnAppearanceControlChanged(ByVal e As EventArgs)
    41.         If Me.Appearance IsNot Nothing Then
    42.             AddHandler Me.Appearance.AppearanceChanged, AddressOf AppearanceControl_AppearanceChanged
    43.             AddHandler Me.Appearance.Disposed, AddressOf AppearanceControl_Disposed
    44.             Me.Renderer = Me.Appearance.Renderer
    45.         Else
    46.             Me.Renderer = New ToolStripProfessionalRenderer()
    47.         End If
    48.         Me.Invalidate()
    49.  
    50.         RaiseEvent AppearanceControlChanged(Me, e)
    51.     End Sub
    52.  
    53.     Private Sub AppearanceControl_Disposed(ByVal sender As Object, ByVal e As EventArgs)
    54.         Me.Appearance = Nothing
    55.         Me.OnAppearanceControlChanged(EventArgs.Empty)
    56.     End Sub
    57.  
    58.     Private Sub AppearanceControl_AppearanceChanged(ByVal sender As Object, ByVal e As EventArgs)
    59.         Me.Renderer = Me.Appearance.Renderer
    60.         CType(Me.Renderer, ToolStripProfessionalRenderer).RoundedEdges = _RoundedEdges
    61.         Me.Invalidate()
    62.     End Sub
    63.  
    64. End Class
    (I don't think the RoundedEdges property does anything for a ToolStripPanel, but it can't hurt)

    Now all you need to do is put your CustomizableToolStrip in this CustomizableToolStripPanel, set the Appearance property (of the panel as well!) to the AppearanceControl you want to use, and change its panel properties (the two I listed above).

    This will give you a horizontal gradient in the ToolStripPanel (unless you chose the same color for begin and end obviously). If you want a vertical gradient, or some other shape, then you're out of luck, my control cannot help you with that. My control merely exposes the properties of the ProfessionalColorTable class (which is used by the ToolStripProfessionalRenderer to draw the toolstrips), allowing you to change them at will. You cannot change how the drawing is done, only the colors.

    If you still want to change the shape (vertical gradient for example), then your only option is to create your own ToolStripProfessionalRenderer, override the methods you need, and let the ToolStripPanel use that instead of the default.



    But thanks for bringing this to my attention, I did not realize that the two panel properties were absolutely useless until now, because there wasn't a CustomizableToolStripPanel yet. I will add it to the first post now.

  11. #11
    Lively Member
    Join Date
    Nov 2004
    Posts
    98

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

    Wow, thanks for the quick and thorough response Nick! I don't know how on earth I missed those properties, works like a charm!

    The horizontal gradient is exactly what I was after, to get the same style most apps use with the gradients on the menubar and toolstrippanel matching.

  12. #12
    Member
    Join Date
    Sep 2010
    Location
    Huntsville, AL
    Posts
    62

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

    I have about a year of .NET programming under my belt, so a lot of things are still new and cool to me. However, this is really cool! Stellar job!

    Actually, I've been playing with the property grid, and was trying to figure out how to make a custom editor. Now, I can learn from your code! I love it.

    Thanks again for all of your effort.

  13. #13
    Junior Member
    Join Date
    Jan 2011
    Posts
    20

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

    Thanks for this tutorial. All examples are very good.

  14. #14
    Junior Member
    Join Date
    Oct 2011
    Posts
    20

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

    Hi Nick,

    how do you think about a customizable BindingNavigator, it has RenderingMode too?

    Regards
    Dietrich

  15. #15
    Junior Member
    Join Date
    Oct 2011
    Posts
    20

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

    Hi Nick,

    I have added the Office2007BlackColortable to the AppearanceControl. Are you interested of the code?

    Dietrich

  16. #16

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

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

    Quote Originally Posted by dherr View Post
    Hi Nick,

    how do you think about a customizable BindingNavigator, it has RenderingMode too?

    Regards
    Dietrich
    I have never actually worked with that control, but I can see now that it inherits ToolStrip. Then it should be quite easy to add it as a supported control for the AppearanceControl. I don't have time right now but you are welcome to try it. What you should do is basically create a class that inherits BindingNavigator and give it an Appearance property (of type AppearanceControl). You can take a look at all the other controls (CustomizableToolStrip, MenuStrip, ContextMenuStrip, StatusStrip, etc) which all do the same thing.

    Quote Originally Posted by dherr View Post
    Hi Nick,

    I have added the Office2007BlackColortable to the AppearanceControl. Are you interested of the code?

    Dietrich
    Sure, that would be cool. Do you have a screenshot too? I'm actually not familiar with a black office 2007 theme, where did you get the colors from? I used Visio 2007 (which was the only Office 2007 product left without a Ribbon) for the blue colors but I don't remember it having a black version too. Maybe it did but I was just too lazy to implement it

  17. #17
    Junior Member
    Join Date
    Oct 2011
    Posts
    20

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

    I got this ColorTable from

    http://www.codeproject.com/KB/miscct...rControls.aspx

    I will send you the code of the complete AppearanceControl in the evening.

    Dietrich

  18. #18
    Junior Member
    Join Date
    Oct 2011
    Posts
    20

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

    Hi Nick,

    see the attachement...

    -Dietrich
    Attached Files Attached Files

  19. #19
    Junior Member
    Join Date
    Oct 2011
    Posts
    20

    New: CustomizableBindingnavigator

    And here is the prescription how to make a CustomizableBindingNavigator:

    make a new class, name it CustomizableBindingNavigator
    take the Code of the CustomizableToolstrip control
    copy and paste this code into the new class
    change the lines
    Code:
    Public Class CustomizableToolStrip
        Inherits ToolStrip
    into
    Code:
    Public Class CustomizableBindingNavigator
    	Inherits BindingNavigator
    That's all!
    The new control can be changed via AppearanceControl.

    Dietrich

  20. #20

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

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

    Thanks dherr, I have added a CustomizableBindingNavigator and an updated AppearanceControl in my first post to include the black style. I think it's god ugly, but hey, no reason not to provide it Thanks for doing the dirty work

  21. #21
    Junior Member
    Join Date
    Oct 2011
    Posts
    20

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

    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.
    Nick, you wrote this in the first thread. But I can't use this function, the ... button is not shown when I click into the propertyfield.
    What can I do?

    Dietrich

  22. #22

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

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

    Hm, it seems the Editor attribute for the CustomAppearance property was changed, did you do that?
    This
    vb.net Code:
    1. <Editor(GetType(AppearanceProperties), GetType(UITypeEditor))> _
    2.     Public Property CustomAppearance() As AppearanceProperties
    should be
    vb.net Code:
    1. <Editor(GetType(CustomAppearancePropertyEditor), GetType(UITypeEditor))> _
    2.     Public Property CustomAppearance() As AppearanceProperties

    I fixed it and changed the ZIP file in the first post, try it now

  23. #23
    Junior Member
    Join Date
    Oct 2011
    Posts
    20

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

    Thanks for the very fast answer
    It works now!

    Nice weekend for you!

    D.

  24. #24
    Member
    Join Date
    Sep 2010
    Location
    Huntsville, AL
    Posts
    62

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

    I've probably said this before, but this is great!

    Also, it's really minimal, but when you have a CustomizableToolStrip and you change the RoundedEdges property in the designer, it doesn't update.

    I don't know if this is the proper way to update the control, but I've added the following line of code to the Set method of the RoundedEdges property:
    Code:
    If _Appearance IsNot Nothing Then _Appearance.OnAppearanceChanged(EventArgs.Empty)

  25. #25

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

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

    I'm not sure what is required to make the ToolStrip redraw its edges. Perhaps a simple Invalidate call would work, or re-assigning the Renderer is probably the way to go. Calling the OnAppearanceChanged method of the Appearance control doesn't seem like a really good solution; for one, that method should be Protected and would not be accessible from the CustomizableToolStrip at all (did you make it Public, or did I make a mistake there and did not make it Protected or at least Pivate?).

  26. #26
    Member
    Join Date
    Sep 2010
    Location
    Huntsville, AL
    Posts
    62

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

    I don't have the code on this computer, but I know I didn't change the scope of the OnAppearanceChanged method. Also, I tried using Me.Invalidate within the Set method of the RoundedEdges property. That didn't work, though, which led me to trying other things.

    I should point out that when I had two CustomizableToolStrips on the same form, whichever RoundedEdges property was set last was the flag that was used for both CustomizableToolStrips. Of course, this could have been a byproduct of me call the OnAppearanceChanged method inside the RoundedEdges property. I know setting one toolstrip to have rounded edges and the other to not have rounded edges is rather strange, I just wanted to bring it up, because it might help shed light on the situation.

  27. #27
    Junior Member
    Join Date
    Oct 2011
    Posts
    20

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

    Hi Nick,

    a question:
    Is it possible to do something like this?

    Dim myColor as Color = (a CustomToolstrip elements color for instance the ToolStripGradientMiddle color)
    ...
    But how?

    Dietrich

  28. #28

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

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

    Sure, just get the color from one of the many ColorTables. I'm pretty sure you can get the ColorTable currently in use from an existing CustomizableToolStrip via
    Code:
    Dim colors As ColorTable = toolStrip1.Renderer.ColorTable
    Perhaps you have to cast the Renderer to ToolStripProfessionalRenderer;
    Code:
    Dim colors As ColorTable = ((ToolStripProfessionalRenderer)toolStrip1.Renderer).ColorTable
    Then just use the color property you need from that
    Code:
    Dim color As Color = colors.ToolStripGradientMiddle

  29. #29
    Junior Member
    Join Date
    Oct 2011
    Posts
    20

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

    Thanks for your lead

    I do it this way now:
    Code:
    Dim myRender As ToolStripProfessionalRenderer = DirectCast(ToolStrip1.Renderer, ToolStripProfessionalRenderer)
    Dim myColors As ProfessionalColorTable = myRender.ColorTable
    Dim myColor As Color = myColors.ButtonSelectedGradientEnd

  30. #30

  31. #31
    New Member
    Join Date
    Nov 2011
    Posts
    8

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

    Hi Nick and dherr,

    I am new to programming Vb.net. Yesterday I downloaded the files in CustomizableStripsLibrary.zip and then inserted into a project I'm developing, but when I tried to build the solution, for each input file, the error 'Type is not defined' is declared, for example :
    Type 'CustomizableStrips.CustomizableToolStrip' is not defined.
    Can you help me solve this problem?

  32. #32

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

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

    Are there errors in any (all?) of those files? What version of the .NET Framework are you compiling against? Is it a Windows Forms Project, or a Control Library project (what this boils down to: did you reference System.Windows.Forms?). Can you post ALL of the errors here?

  33. #33
    New Member
    Join Date
    Nov 2011
    Posts
    8

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

    I'm compiling with .NET Framework 4 Client, Windows Forms Project, System.Windows.Forms referenced.
    The errors are:
    Error 1 Type 'CustomizableStrips.CustomizableToolStrip' is not defined.
    Error 2 Type 'CustomizableStrips.AppearanceControl' is not defined.
    Error 3 Type 'CustomizableStrips.CustomizableStatusStrip' is not defined.
    Error 4 Type 'CustomizableStrips.CustomizableMenuStrip' is not defined.
    Error 5 Type 'CustomizableStrips.CustomizableToolStrip' is not defined.
    Error 6 Type 'CustomizableStrips.CustomizableStatusStrip' is not defined.
    Error 7 Type 'CustomizableStrips.CustomizableMenuStrip' is not defined.
    Error 8 Type 'CustomizableStrips.AppearanceControl' is not defined.

  34. #34

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

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

    Where are you getting these errors? What did you do with any of the controls? If you just add the files to the project and build then I don't understand why you'd get these errors.

  35. #35
    New Member
    Join Date
    Nov 2011
    Posts
    8

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

    Yes, I just add the files to the project and build. After click on built vb is showing the error list.

  36. #36
    Member
    Join Date
    Sep 2010
    Location
    Huntsville, AL
    Posts
    62

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

    Quote Originally Posted by AMedina View Post
    Yes, I just add the files to the project and build. After click on built vb is showing the error list.
    I've had those errors too. The name of the solution that NickThissen used to create the Customizable Strips was named "CustomizableStrips", so when you added them to your project, they are referencing a NameSpace that doesn't exist. If you go to each line of code that has that error and change "CustomizableStrips" to the name of your solution, the errors should go away.

  37. #37

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

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

    Quote Originally Posted by arcanine View Post
    I've had those errors too. The name of the solution that NickThissen used to create the Customizable Strips was named "CustomizableStrips", so when you added them to your project, they are referencing a NameSpace that doesn't exist. If you go to each line of code that has that error and change "CustomizableStrips" to the name of your solution, the errors should go away.
    Ah, good catch! An easier fix is to put the files in a new control library project called CustomizableStrips, or just wrap each class in a namespace called called like that.

  38. #38
    Member
    Join Date
    Sep 2010
    Location
    Huntsville, AL
    Posts
    62

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

    Quote Originally Posted by NickThissen View Post
    Ah, good catch! An easier fix is to put the files in a new control library project called CustomizableStrips, or just wrap each class in a namespace called called like that.
    Agreed! I added them manually a couple of times and then started using the controls library method, and it is a whole lot better!

  39. #39
    New Member
    Join Date
    Nov 2011
    Posts
    8

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

    Quote Originally Posted by arcanine View Post
    Agreed! I added them manually a couple of times and then started using the controls library method, and it is a whole lot better!
    Thank you, Arcanine and Nick. I have the application working.
    One question: is possible to get menus such as Visual Studio 2010, where there are items with color gradients?. I've tried, but I have not been able to achieve.

  40. #40

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

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

    Quote Originally Posted by AMedina View Post
    One question: is possible to get menus such as Visual Studio 2010, where there are items with color gradients?. I've tried, but I have not been able to achieve.
    Not with these controls.

    There are basically two ways to custom render a ToolStrip (and MenuStrip, etc):

    (1) Implement your own ProfessionalColorTable, where you specify which colors the ToolStrip uses.

    (2) Implement your own ToolStripProfessionalRenderer, where you draw everything manually using GDI+ techniques.


    My control here uses option (1). It basically tells the ToolStrip to render itself like it usually does, except you tell it to use some different colors. Simply said: you can only change the colors, but you cannot add new colors or color stuff where the regular ToolStrip doesn't paint. You cannot create gradients that don't exist in the regular ToolStrip.


    Option (2) gives you much more freedom, you can draw whatever you want and however you want it. This way you are free to draw a gradient wherever you want. Unfortunately, it's a lot more work!


    Luckily for you, I happened to have created quite a few custom ToolStripProfessionalRenderers (option 2), including a VS2008 style and a VS2010 style You can find the links in my signature.

Page 1 of 2 12 LastLast

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