반응형
visual basic,비주얼베이직,vb .net강좌-팝업메뉴 사용하기,popup menu,ContextMenuStrip
반드시 위처럼 form 속성에 ContextMenuStrip 지정해줘야 합니다.
위에 메뉴를 클릭하면 click event 소스창으로 넘어갑니다.
Public Class Form1
Private Sub FileToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FileToolStripMenuItem.Click
TextBox1.Text = "file"
End Sub
Private Sub CopyToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CopyToolStripMenuItem.Click
TextBox1.Text = "copy"
End Sub
Private Sub PasteToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PasteToolStripMenuItem.Click
TextBox1.Text = "paste"
End Sub
End Class
반응형