创建类表
(
Color = dotNetClass "System.Drawing.Color"
ScrollBars = dotNetClass "System.Windows.Forms.ScrollBars"
-- Create Tabs Container
tabControl1 = dotnetobject "system.windows.forms.TabControl"
tabControl1.size = dotnetobject "system.drawing.size" 395 195
tabControl1.Location = dotnetobject "System.Drawing.Point" 0 0
--Create Tabs
tabPage1 = dotnetobject "System.Windows.Forms.TabPage"
tabPage1.text = "Goodbye World"
tabPage2 = dotnetobject "System.Windows.Forms.TabPage"
tabPage2.text = "Hello World"
tabPage1.backColor = color.fromArgb 200 200 200
tabPage2.backColor = color.fromArgb 200 200 200
-- Create Datagrid
DGrid1 = dotnetobject "System.Windows.Forms.DataGrid"
DGrid1.Location = dotNetObject "System.Drawing.Point" 10 10
DGrid1.Width = 365
DGrid1.Height = 120
DGrid1.Visible = true
-- Add Some Columns to the Datagrid
dt = dotnetobject "system.data.datatable"
Column1 = dotnetclass "System.windows.data.DataColumn"
-- Create TextBox
TB1TextBox = dotNetObject "System.Windows.Forms.TextBox"
TB1TextBox.Location = dotNetObject "System.Drawing.Point" 10 10
TB1TextBox.Width = 365
TB1TextBox.Height = 120
TB1TextBox.Visible = true
TB1TextBox.MultiLine = true
TB1TextBox.ScrollBars = ScrollBars.Vertical
TB1TextBox.AcceptsReturn = true
TB1TextBox.AcceptsTab = true
TB1TextBox.WordWrap = true
-- Create Buttons
button01 = dotnetobject "System.Windows.Forms.button"
button01.text = "goodbye"
button01.Location = dotNetObject "System.Drawing.Point" 300 138
-- Add UI elements to Tabs
tabpage1.controls.add(TB1textbox)
tabpage1.controls.add(button01)
tabpage2.controls.add(DGrid1)
-- Add Tabs to Tab Container
tabcontrol1.controls.add(tabpage1)
tabcontrol1.controls.add(tabpage2)
-- Add Tab Container to UI Form
TabForm.Controls.Add(tabcontrol1)
-- Show application Form
TTApp = dotNetClass "System.Windows.Forms.Application"
TTApp.Run TabForm
)