Dim instance As Std = New Std() Dim value1 As ToolStripButton = New ToolStripButton() instance.AddInMenuAddOnce(value1) Dim value2 As ToolStripLabel = New ToolStripLabel() instance.AddInMenuAddOnce(value2) Dim value3 As ToolStripSplitButton = New ToolStripSplitButton() instance.AddInMenuAddOnce(value3) Dim value4 As ToolStripDropDownButton = New ToolStripDropDownButton() instance.AddInMenuAddOnce(value4) Dim value5 As ToolStripSeparator = New ToolStripSeparator() instance.AddInMenuAddOnce(value5) Dim value6 As ToolStripComboBox = New ToolStripComboBox() instance.AddInMenuAddOnce(value6) Dim value7 As ToolStripTextBox = New ToolStripTextBox() instance.AddInMenuAddOnce(value7) Dim value8 As ToolStripProgressBar = New ToolStripProgressBar() instance.AddInMenuAddOnce(value8)
'Stdクラス AddInMenuAddOnceプロパティ Imports System.Windows.Forms Public Class AddIn Private std As Std Public Sub New() std = New Std() End Sub Public Sub AddIn_Start() tsbOn() tss() tsbOff() tsLabel() tsText() End Sub '''''' ONと言う名前のボタンを追加します。 ''' Private Sub tsbOn() Dim tsbOn As ToolStripButton = New ToolStripButton("ON") std.AddInMenuAddOnce(tsbOn) End Sub '''''' OFFと言う名前のボタンを追加します。 ''' Private Sub tsbOff() Dim tsbOff As ToolStripButton = New ToolStripButton("OFF") std.AddInMenuAddOnce(tsbOff) End Sub '''''' セパレーターを追加します。 ''' Private Sub tss() Dim tss As ToolStripSeparator = New ToolStripSeparator() tss.AutoSize = True std.AddInMenuAddOnce(tss) End Sub '''''' ラベルを追加します。 ''' Private Sub tsLabel() Dim tsl As ToolStripLabel = New ToolStripLabel tsl.Text = "ラベル" std.AddInMenuAddOnce(tsl) End Sub '''''' テキストボックスを追加します。 ''' Private Sub tsText() Dim tst As ToolStripTextBox = New ToolStripTextBox std.AddInMenuAddOnce(tst) End Sub End Class
'Stdクラス AddInMenuAddOnceプロパティ Imports System.Windows.Forms Public Class AddIn Private std As Std Public Sub New() std = New Std() End Sub Public Sub AddIn_Start() 'ドロップダウンメニューの準備 Dim ddButton As ToolStripDropDownButton = New ToolStripDropDownButton("User") Dim dd As ToolStripDropDownMenu = New ToolStripDropDownMenu() ddButton.DropDown = dd 'ボタン Dim tsbOn As ToolStripButton = New ToolStripButton("ON") dd.Items.Add(tsbOn) 'セパレータ Dim tss As ToolStripSeparator = New ToolStripSeparator() tss.AutoSize = True dd.Items.Add(tss) 'ボタン Dim tsbOff As ToolStripButton = New ToolStripButton("OFF") dd.Items.Add(tsbOff) 'ラベル Dim tsl As ToolStripLabel = New ToolStripLabel tsl.Text = "ラベル" dd.Items.Add(tsl) 'テキストボックス Dim tst As ToolStripTextBox = New ToolStripTextBox dd.Items.Add(tst) 'チェックボックス Dim ck As CheckBox = New CheckBox ck.Text = "許可" ck.BackColor = System.Drawing.Color.Transparent Dim cHost As ToolStripControlHost = New ToolStripControlHost(ck) dd.Items.Add(cHost) 'コンボボックス Dim tscb As ToolStripComboBox = New ToolStripComboBox() tscb.Items.Add("あ") tscb.Items.Add("い") tscb.Items.Add("う") tscb.Items.Add("え") tscb.Items.Add("お") dd.Items.Add(tscb) 'ドロップダウンメニューを追加 std.AddInMenuAddOnce(ddButton) End Sub End Class
'Stdクラス AddInMenuAddOnceプロパティ Imports System.Windows.Forms Public Class AddIn Private std As Std Public Sub New() std = New Std() End Sub Public Sub AddIn_Start() 'ドロップダウンメニューの準備 Dim ddButton As ToolStripDropDownButton = New ToolStripDropDownButton("User") Dim dd As ToolStripDropDownMenu = New ToolStripDropDownMenu() ddButton.DropDown = dd 'ラベル Dim tsl As ToolStripLabel = New ToolStripLabel tsl.Text = "ラベル" dd.Items.Add(tsl) 'ドロップダウンメニュー Dim ddButton2 As ToolStripMenuItem = New ToolStripMenuItem("2") Dim dd2 As ToolStripDropDownMenu = New ToolStripDropDownMenu() ddButton2.DropDown = dd2 dd.Items.Add(ddButton2) 'ラベル Dim tsl2 As ToolStripLabel = New ToolStripLabel tsl2.Text = "ラベル2" dd2.Items.Add(tsl2) 'ドロップダウン Dim ddButton3 As ToolStripMenuItem = New ToolStripMenuItem("3") Dim dd3 As ToolStripDropDown = New ToolStripDropDown() ddButton3.DropDown = dd3 dd.Items.Add(ddButton3) 'ラベル Dim tsl3 As ToolStripLabel = New ToolStripLabel tsl3.Text = "ラベル3" dd3.Items.Add(tsl3) 'ドロップダウンメニュー Dim ddButton4 As ToolStripMenuItem = New ToolStripMenuItem("4") Dim dd4 As ToolStripDropDownMenu = New ToolStripDropDownMenu() ddButton4.DropDown = dd4 dd3.Items.Add(ddButton4) 'ラベル Dim tsl5 As ToolStripLabel = New ToolStripLabel tsl5.Text = "ラベル5" dd4.Items.Add(tsl5) 'ドロップダウンメニューを追加 std.AddInMenuAddOnce(ddButton) End Sub End Class
このページのQRコード
便利ウェブサイト
便利 Android アプリ
便利 iOS(iPhone,iPad) アプリ