Menu Merge

5 posts, 0 answers
  1. Gifford
    Gifford avatar
    3 posts
    Member since:
    Jan 2013

    Posted 19 Aug 2015 Link to this post

    Hi I am having trouble merging the main menu with an MDIChild form.  What i what to have happen is the MDI child menu is inserted into the main menu at particular points.  For example:

    Main Menu:     

  2. Gifford
    Gifford avatar
    3 posts
    Member since:
    Jan 2013

    Posted 19 Aug 2015 in reply to Gifford Link to this post

    Ok lets try again, posted by mistake.

    I am having trouble merging the main menu with an MDIChild form.  What i what to have happen is the MDI child menu is inserted into the main menu at particular points.  For example:

    Main Menu:  File  Windows  Help

    MDI Form:    Project  Query

    Merged Main Menu:  File  Project  Query  Windows  Help

    What i get automatically when the MDI form is maximized is:  File Windows Help Project Query

    Doesn't seem to matter what i use for the MergeIndex,  MergeType and MergeOrder properties.  The MDI child menu is always on the right of the main menu help.

    Anybody know how to do this?

    I can provide a demo project in VB.NET 2012 and Telerik WinForms VSExtensions 2014.6.1128.0 if needed.

    Thanks!

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 24 Aug 2015 Link to this post

    Hello Gifford,

    Thank you for writing.

    I have tested this and it appears that the MergeOrder property is not working correctly. I have logged this issue in our Feedback Portal. You can track the item for status changes and add your vote for it here.

    I have attached a small project to the issue description. It shows how you can manually create such functionality.

    Your Telerik Points have been updated for this report.

    Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Gifford
    Gifford avatar
    3 posts
    Member since:
    Jan 2013

    Posted 26 Aug 2015 in reply to Dimitar Link to this post

    Hi Dimitar,

    Thanks for the update.  Here is what I did for a work around.

    I declared a member variable reference to the main MDI forms menu then created the UpdateMenu and RemoveMenuFromParent functions.
    The added event handlers for these three events and updated the menus accordingly.

    Private _parentMenu As RadMenu



    ''' <summary>
            ''' Adds this forms menus to the parent form's menu
            ''' </summary>
            ''' <remarks></remarks>
            Private Sub UpdateMenu()
                If _parentMenu Is Nothing Then
                    Throw New InvalidOperationException("The parent menu has not been set properly.")
                End If
                'if manually add do this
                _parentMenu.Items.Insert(1, ActionMenuList)
                _parentMenu.Items.Insert(2, QueryManagementMenuList)
            End Sub

    ''' <summary>
            ''' Removes this forms menu items from the parent window
            ''' </summary>
            ''' <remarks></remarks>
            Private Sub RemoveMenuFromParent()
                If _parentMenu Is Nothing Then
                    Throw New InvalidOperationException("The parent menu has not been set properly.")
                End If
              ' if manually adding do this
                If _parentMenu.Items(1).Equals(ActionMenuList) Then
                    _parentMenu.Items.RemoveAt(1)
                    _parentMenu.Items.RemoveAt(1)

                    mnuMainMenu.Items.Add(ActionMenuList)
                    mnuMainMenu.Items.Add(QueryManagementMenuList)
                End If
            End Sub

    Private Sub ProjectViewerForm_Activated(sender As Object, e As EventArgs) Handles Me.Activated
                Try
                    If WindowState = FormWindowState.Maximized Then
                        UpdateMenu()
                    End If
                Catch ex As Exception
                    'Your Display Error Code Here
                End Try
            End Sub

            Private Sub ProjectViewerForm_Deactivate(sender As Object, e As EventArgs) Handles Me.Deactivate
                Try
                    RemoveMenuFromParent()
                Catch ex As Exception
                    'Your Display Error Code Here
                End Try
            End Sub

            Private Sub ProjectViewerForm_SizeChanged(sender As Object, e As EventArgs) Handles Me.SizeChanged
                Try
                    If _parentMenu IsNot Nothing Then
                        If WindowState = FormWindowState.Maximized Then
                            UpdateMenu()
                        Else
                            RemoveMenuFromParent()
                        End If
                    End If
                Catch ex As Exception
                    'Your Display Error Code Here
                End Try
            End Sub

  6. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 27 Aug 2015 Link to this post

    Hello Gifford,

    I am glad that you have implemented a workaround for this case. Do not hesitate to contact us if you have other questions.
     
    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready