Frequently Asked Questions

Add/remove Context Menu items?

You can add items to Context Menu using ContextMenu Property and MenuClick Event by inserting the following code:

Private Const MF_BYCOMMAND = &H0&
Private Const MF_STRING = &H0&
Private Declare Function InsertMenu Lib "user32" Alias "InsertMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As Long
Private Sub Form_Load()
If wodTelnetDLX1.ContextMenu Then
        InsertMenu wodTelnetDLX1.ContextMenu, 32768, MF_BYCOMMAND + MF_STRING, 32768, "Test"
End If
wodTelnetDLX1.Connect

End Sub

Private Sub wodTelnetDLX1_MenuClick(ByVal ID As Long)
If ID = "32768" Then
    MsgBox "Test"
End If
End Sub

  

To delete menu items from Context Menu insert following code: 
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Sub Form_Load()
If wodTelnetDLX1.ContextMenu Then
        DeleteMenu wodTelnetDLX1.ContextMenu, 32773, 32773 'This disables "Copy" option
        DeleteMenu wodTelnetDLX1.ContextMenu, 32774, 32774 'This disables "Paste" option
End If
wodTelnetDLX1.Connect
End Sub


These samples were made with VB6.


 Last updated Thu, Nov 7 2013 11:00pm

Please Wait!

Please wait... it will take a second!