dcsimg
Page 2 of 2 FirstFirst 12
Results 41 to 64 of 64

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

  1. #41
    New Member
    Join Date
    Nov 2011
    Posts
    8

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

    Thank you, Nick.

  2. #42
    Junior Member ApDev's Avatar
    Join Date
    Nov 2011
    Location
    Madrid
    Posts
    23

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

    Wow! That's good!

    I've always been looking for that stuff but I did not found thing... thanks

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

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

    I know I shouldn't post questions in existing threads, but this only applies to the Customizable Strips code.

    The problem I'm having pertains to using Customizable Strips and MDI forms. My limited knowledge of MDI apps tells me that when the child form is maximized, it's menu is merged with the parent's menu. Using the standard MenuStrips doesn't cause any problems. However, using the Customizable Strips the menus don't seem to merge at all. The first attached image shows what I mean (I boxed out sensitive information). The child form's title bar is not merged with the main form's menu bar.

    The second attached image is a normal MDI app using the standard Menu Strips.
    Attached Images Attached Images   

  4. #44

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

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

    That menu on the first image doesn't look like a MenuStrip control, isn't it the old Menu or MenuBar control or something like that? I don't think you can merge MenuStrips and MenuBars.

    If it is indeed a regular MenuStrip (eg: the only thing you changed is replacing the CustomizableMenuStrip with the regular MenuStrip on your child form) then I have no clue. The Customizable___ controls have hardly any custom code as you can see, I don't touch the merging capabilities at all, all I do is change their Renderer property on the fly.

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

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

    Well I feel silly. When I changed the MenuStrip from standard to customizable, the MainMenuStrip property of the Parent Form was set to nothing. Setting this property to the CustomizableMenuStrip solved everything.

  6. #46
    Junior Member
    Join Date
    Oct 2011
    Posts
    20

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

    Hi Nick,

    a question to you about CustomizableStatusstrip:
    when you choose the colorscheme black for instance then should be the forecolor of the texts in 'white'.
    How can I do that?...

    Dietrich

  7. #47

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

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

    Not sure. If the ColorTables don't have any properties for the text forecolor than I'd say you can't force that color. You'd just have to set it for each 'control' on the strips manually (I think they should have a Forecolor property?).

  8. #48
    New Member
    Join Date
    Feb 2012
    Posts
    1

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

    Hello dear,
    I am having a problem while I try to add these files in a vb class library project and recieve a lot of errors like 'Error 101 Type 'Color' is not defined.
    ' . As i am a newbie in VB.Net and have no clue how to deal with these errors. M i missing something to add ? Can someone help me n this

  9. #49
    Member
    Join Date
    May 2011
    Location
    Russia, N.Novgorod
    Posts
    35

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

    I'd want to implement your AppearanceControl -it's nice, but when I set a form for your AppearaceEditor it requires a parameter (ap) (I downloaded CustomizableStripsLibrary.zip ). What does it mean and what must I do?
    Alex

  10. #50

    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 RajaFaisal View Post
    Hello dear,
    I am having a problem while I try to add these files in a vb class library project and recieve a lot of errors like 'Error 101 Type 'Color' is not defined.
    ' . As i am a newbie in VB.Net and have no clue how to deal with these errors. M i missing something to add ? Can someone help me n this
    Most likely you don't have a reference to System.Drawing, which includes the System.Drawing.Drawing2D namespace in which the Color type exists. You mention a Class Library project which indeed by default does not have this reference, so all you need to do is add a reference to System.Drawing and then correct the errors by hovering over them (in the code editor, not the error list), clicking the little button that pops up and following the instructions.

    Quote Originally Posted by alexkn View Post
    I'd want to implement your AppearanceControl -it's nice, but when I set a form for your AppearaceEditor it requires a parameter (ap) (I downloaded CustomizableStripsLibrary.zip ). What does it mean and what must I do?
    Alex
    Not sure what you mean, what does "set a form for your AppearanceEditor" mean?

  11. #51
    Member
    Join Date
    May 2011
    Location
    Russia, N.Novgorod
    Posts
    35

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

    I do new Windows Form project and the first form of this project invokes another form (the frmAppearanceEditor ), but the last requires a parameter (ap).

  12. #52

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

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

    So you are trying to use the frmAppearanceEditor form manually, for your own use? Why? That form is used by the AppearanceControl when you open the Custom appearance property, it shows the preview and the property grid used to set the colors. You shouldn't use it for your own application.

    Are you trying to allow your customers to customize the application themselves? If so, I might be able to find some help for you but simply using that form is not the way to go in this case I think, there's a lot of logic in there that involves the design-time serialization of the colors which you don't need during run-time.

  13. #53
    Member
    Join Date
    May 2011
    Location
    Russia, N.Novgorod
    Posts
    35

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

    Sorry for my misunderstanding. I thought this is a standalone application.
    That form is used by the AppearanceControl when you open the Custom appearance property, it shows the preview and the property grid used to set the colors.
    How can I use it? When I press a button with three dots (in property window) against of the Customappearance property of Appearance it happens nothing (previously I select in Appearance preset=custom)

  14. #54

    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, if you drag an AppearanceControl to your form (in design-time) and then press the [...] button in the property grid for the CustomAppearance property, the editor as shown in the third screenshot (of the opening post) should show and you should be able to select your colors.

  15. #55
    Member
    Join Date
    May 2011
    Location
    Russia, N.Novgorod
    Posts
    35

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

    I do all as you say but...

  16. #56
    Member
    Join Date
    May 2011
    Location
    Russia, N.Novgorod
    Posts
    35

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

    Success! All I need - to compile the project.
    But the button "Save" doesn't work- gives an error. It text rather long but cuncludes with phrase "frmAppearanceEditor 93 line"
    this line is selected by red
    Code:
      Public Sub SaveAppearance(ByVal xmlFile As String, ByVal ac As AppearanceControl)
            Try
                Using fs As New FileStream(xmlFile, FileMode.Create, FileAccess.Write, FileShare.None)
                    Dim ser As New XmlSerializer(GetType(AppearanceControl.AppearanceProperties))
                    ser.Serialize(fs, ac.CustomAppearance)
                    fs.Close()
                End Using
            Catch ex As Exception
                MessageBox.Show(ex.ToString)
            End Try
        End Sub

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

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

    Hi Nick,
    I try to use the ContextMenustrip.
    The situation:
    A MDI-Cildform with a Datagridview and I want to show the Contextmenustrip at Mousedownevent. The menu shows but not at mouseposition but rather in the left upper corner of the screen...

    What's wrong?

    Regards-
    Dietrich

  18. #58

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

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

    I doubt it has something to do with my custom ContextMenuStrip, because all it does is set the Renderer property. Try replacing it with a regular ContextMenuStrip and see if that does the same thing?

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

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

    I do it this way now:
    Code:
    ctms.Show(New Point(Cursor.Position.X + Cursor.Size.Width / 2, _
                        Cursor.Position.Y + Cursor.Size.Height / 2))
    But the next problem is in designtime. The menustrip has thre items, each with an image. When I change an image then in runtime the strip shows the old image further on...

    Dietrich

  20. #60

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

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

    That's not really the normal way to show a contextmenustrip, usually you use assign it to the ContextMenuStrip property of the control you want it to show for, and it will show on a right-click.

    As for your image problem, I'm not sure. Try closing the form in the designer, saving the solution, closing Visual Studio and finally deleting the bin and obj folders from the project. Then open it again and Build the solution, that might fix it. But that's just speculation, it's the first thing you should try when you see some strange behavior like that.

    Still, you didn't answer my most important question: does the same happen (for both problems) if you use a regular ContextMenuStrip instead of my custom one? If it does, then the problem is not my custom ContextMenuStrip.

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

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

    Excuse me...

    Also a 'normal' ContextMenustrip doesn't show the normal way, don't know why...
    But with my shown method all functions with CustomContextMenustrip, That's OK.

    Dietrich

  22. #62

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

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

    Well, if the normal ContextMenuStrip doesn't behave as you want either then the problem is not my CustomContextMenuStrip. Perhaps you'd be better off posting the problem in the regular forum where you will get a lot more help. If it turns out to be a problem with my custom ContextMenuStrip I can take a look at it, but I doubt it.

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

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

    Hi all,
    do you use the ReportViewer control (I use version 11.0) eventually?
    This control has a internal Toolstrip too! And you can adapt the AppearanceControl to this Toolstrip with the following code:
    Dim ts() As Control = ReportViewer1.Controls.Find("ToolStrip1", True)
    If Not IsNothing(ts) Then
    Dim tsItem As ToolStrip = DirectCast(ts(0), ToolStrip)
    With tsItem
    .AutoSize = True
    .RenderMode = ToolStripRenderMode.Professional
    .Renderer = AppearanceControl1.Renderer
    End With
    End If

    Greetings-
    Dietrich

  24. #64
    New Member
    Join Date
    Oct 2014
    Posts
    2

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

    Quote Originally Posted by NickThissen View Post
    Most likely you don't have a reference to System.Drawing, which includes the System.Drawing.Drawing2D namespace in which the Color type exists. You mention a Class Library project which indeed by default does not have this reference, so all you need to do is add a reference to System.Drawing and then correct the errors by hovering over them (in the code editor, not the error list), clicking the little button that pops up and following the instructions.
    Hello Nick, I absolutely love the customizable strips, I am having the same issue as this user. I have added the appropriate references but it comes up with 102 errors... They vary from: 'Invalidate is not a member of CustomizableStrips.CustomizableMenuStrip', 'Type color is not defined' and 'Value of type CustomizableStrips.CustomizableToolStrip cannot be converted to Systems.Windows.Form.Control' What should I do? When hovering over the errors in the code editor, they suggest generating method stubs or classes.

Page 2 of 2 FirstFirst 12

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