StrataFrame Forum

How to handel the sub item click in the ThemedLinkMenu

http://forum.strataframe.net/Topic20910.aspx

By Raymond Lo - 11/26/2008

Dear All,

     In the ThemedLinkMenu sample, when Link Menu Style click will diplay two sub item. If user click the sub1 or sub2 how to catch the item click event. please provide the code sample. (I want to know how to apply the subitem in the ThemedLinkMenu and how to detect the click when user clicked)

===========================================

    Private Sub MyThemedLinkMenu_ItemClicked(ByVal sender As System.Object, ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.ThemedLinkMenuClickEventArgs) Handles MyThemedLinkMenu.ItemClicked

        Select Case MyThemedLinkMenu.ActiveItem.Title

         Case "Sub1"
                MsgBox("you click Sub1", MsgBoxStyle.Information, AcceptButton)
                '-- Set the GradientFormHeader detail text to be specific to the active page
                Me.MyGradientFormHeader.DetailText = _PageTitles(Me.PanelManager1.CurrentPageIndex)
            Case "Customers"
                MsgBox("you click customers", MsgBoxStyle.Information, AcceptButton)
            Case "Advanced Usage"
                MsgBox("you click Advanced Usage", MsgBoxStyle.Information, AcceptButton)

        End Select
    End Sub

==========

in this sample, when user click sub1 or sub2 in the subitem I can not catch the user action.

Thanks a lot.

By Ivan George Borges - 11/27/2008

Hi Raymond.

All your Links and SubLinks will have a Key property. Assign a different one to each of them, and then use them to cacth the ItemClicked:

        Select Case e.Item.Key
            Case "MyKey1"

            Case "MyKey2"

        End Select

By Raymond Lo - 11/27/2008

Hi Ivan,

    It's work, Thank you very much!

By Ivan George Borges - 11/27/2008

Hey Raymond.

You're welcome! Cool