This is a migrated thread and some comments may be shown as answers.

Menu Merge

4 Answers 75 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Gifford
Top achievements
Rank 1
Gifford asked on 19 Aug 2015, 08:10 PM

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:     

4 Answers, 1 is accepted

Sort by
0
Gifford
Top achievements
Rank 1
answered on 19 Aug 2015, 08:17 PM

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!

0
Dimitar
Telerik team
answered on 24 Aug 2015, 12:00 PM
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
0
Gifford
Top achievements
Rank 1
answered on 26 Aug 2015, 03:53 PM

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

0
Dimitar
Telerik team
answered on 27 Aug 2015, 01:27 PM
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
Tags
Menu
Asked by
Gifford
Top achievements
Rank 1
Answers by
Gifford
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or