1 Replies - 1929 Views - Last Post: 24 September 2013 - 11:26 PM Rate Topic: -----

#1 [email protected].com   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 24-September 13

Popup menu in vb.net

Posted 24 September 2013 - 11:16 PM

Thanks For your reply......But my Situation is as below please Check it and give me a nice solution

I want to create a custom control in vb.net, which behaves like vb6 popupmenu & it acts like form show dialog . Popup menu filled dynamically & my O/P depends only upon click event result of popupmenu.

By using context menustrip problem is click event of context menustrip is raised after all events of form which calls context menustrip . Hence I cant continue rest part of the program in Mainform using context menustrip itemclicked result.

1.My Main Form MouseUp is Called

2.Inside MouseUp Context Menu Is shown

3.After Show of Context Menu Strip the next line of Main Form MouseUp Continues result obtained from ContextMenuStrip_ItemClicked

4. ContextMenuStrip_ItemClicked have Somany other functions and codes which cannot be replaced outside of it

 Private Sub ChangeLayer(ByRef X As Double, ByRef Y As Double, ByRef D As String, ByRef T As Integer)''*****Change Layer Called in MouseUp Event of MainForm
        Dim A As String
        Dim objDrawingPoint As New Drawing.Point
        Dim cms As New ContextMenuStrip
        DeleteFlag = False
        'A = M_PlaceLayer.Text
        A = PlaceOn.Text
        If T Then
            M_SelLayC(0).Enabled = False : M_SelLayC(1).Enabled = False
            M_SelLayS(16).Enabled = False : M_SelLayS(17).Enabled = False
            CompLayer(0).Enabled = False : CompLayer(1).Enabled = False
            SolderLayer(16).Enabled = False : SolderLayer(17).Enabled = False
        End If
        '' M_PlaceLayer.Text = StrAnsi(D)
        PlaceOn.Text = StrAnsi(D)
        m_LayerFlag = False
        objDrawingPoint = ViewPicture.PointToClient(Cursor.Position)
        With objDrawingPoint

            cm_FO.Show(ViewPicture, New Point(.X, .Y))'''**Context MenuStrip Show() 


        End With

        '''''Depends on Result of ItemClicked of cm_FO contextmenustrip below code works

'******************************************************

'Code Below Works with result of Context MenuStrip ItemClicked 

'******************************************************

'         M_PlaceLayer.Text = StrAnsi(A)
        PlaceOn.Text = StrAnsi(A)
        If T Then
            M_SelLayC(0).Enabled = True : M_SelLayC(1).Enabled = True
            M_SelLayS(16).Enabled = True : M_SelLayS(17).Enabled = True
            CompLayer(0).Enabled = True : CompLayer(1).Enabled = True
            SolderLayer(16).Enabled = True : SolderLayer(17).Enabled = True
        End If
'****************************************************
    End Sub

This post has been edited by modi123_1: 24 September 2013 - 11:24 PM
Reason for edit:: highlight your text and click the 'code' button


Is This A Good Question/Topic? 0
  • +

Replies To: Popup menu in vb.net

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14045
  • View blog
  • Posts: 56,207
  • Joined: 12-June 08

Re: Popup menu in vb.net

Posted 24 September 2013 - 11:26 PM

Quote

give me a nice solution

Do you just want the code, or are you going to tell us what is wrong with your current setup, any error text, and what your code should be doing?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1