窗口 AfterLoad
Dim controls As New System.Windows.Forms.ToolStrip
e.Form.baseform.Controls.Add(controls)
Dim ToolStripButton1 = New System.Windows.Forms.ToolStripButton
Dim ToolStripButton2 = New System.Windows.Forms.ToolStripButton
Dim ToolStripButton3 = New System.Windows.Forms.ToolStripButton
Dim ToolStripButton4 = New System.Windows.Forms.ToolStripButton
controls.Items.AddRange(New System.Windows.Forms.ToolStripItem() {ToolStripButton1, ToolStripButton2, ToolStripButton3, ToolStripButton4})
ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
ToolStripButton1.Name = "ToolStripButton1"
ToolStripButton1.Text = "ToolStripButton1"
'
'
ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
ToolStripButton2.Name = "ToolStripButton2"
ToolStripButton2.Text = "ToolStripButton2"
'
'
ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
ToolStripButton3.Name = "ToolStripButton3"
ToolStripButton3.Text = "ToolStripButton3"
'
'
ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
ToolStripButton4.Name = "ToolStripButton4"
ToolStripButton4.Text = "ToolStripButton4"
AddHandler controls.ItemClicked, AddressOf ItemClicked
函数 "qq群"
Dim e As Object = Args(0)
Dim Sender As Object = Args(1) '传递给全局代码的第二个参数
MessageBox.show(Sender.ClickedItem.text) ’具体参数按你自己的需求,可以放入全局变量
全局
Public Sub ItemClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs)
Functions.Execute("qq群",sender,e)
End Sub