Results 1 to 8 of 8

Thread: [RESOLVED] Textbox1 to Inherit ContextMenu

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2017
    Posts
    26

    Resolved [RESOLVED] Textbox1 to Inherit ContextMenu

    I use the following code according to https://docs.microsoft.com/en-us/dot...with-a-control which works fine for windows form1
    Code:
    Public Class Form1
        Private contextMenuStrip1 As ContextMenuStrip
        Private toolStripMenuItem1 As ToolStripMenuItem
        Private toolStripMenuItem2 As ToolStripMenuItem
        'Private toolStripTextBox1 As ToolStripTextBox
    
        Public Sub New()
                InitializeComponent()
            Me.components = New System.ComponentModel.Container()
            'Me.toolStripTextBox1 = New System.Windows.Forms.ToolStripTextBox()
            Me.contextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
    
            Me.toolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
            Me.toolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
    
            Me.contextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripMenuItem1, Me.toolStripMenuItem2})
            Me.contextMenuStrip1.Name = "contextMenuStrip1"
            Me.contextMenuStrip1.RightToLeft = System.Windows.Forms.RightToLeft.No
            Me.contextMenuStrip1.Size = New System.Drawing.Size(131, 48)
    
    
            Me.toolStripMenuItem1.Name = "toolStripMenuItem1"
            Me.toolStripMenuItem1.Text = "&Cut"
    
            Me.toolStripMenuItem2.Name = "toolStripMenuItem2"
            Me.toolStripMenuItem2.Text = "&Copy"
            Me.ContextMenuStrip = Me.contextMenuStrip1
        End Sub
    End Class
    When trying to inherit to textbox1 it displays error. How can I link this menu to textbox? Can I use toolStripTextBox or something?
    Thanks.
    Last edited by NewWorldOrder; Aug 15th, 2017 at 12:56 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width