MÌnh muốn tạo một winfom như hình
Khi tích vào thêm thì sẽ thêm vào các hàng như hình ,khi tích tích vào xóa thì xóa hàng đó đi
Mình sử dụng SharpDevelop
import System.Drawing import System.Windows.Forms
from System.Drawing import * from System.Windows.Forms import *
class MainForm(Form): def __init__(self): self.InitializeComponent() def InitializeComponent(self): self._comboBox1 = System.Windows.Forms.ComboBox() self._comboBox2 = System.Windows.Forms.ComboBox() self._button1 = System.Windows.Forms.Button() self._button2 = System.Windows.Forms.Button() self._button3 = System.Windows.Forms.Button() self._button4 = System.Windows.Forms.Button() self._comboBox3 = System.Windows.Forms.ComboBox() self._comboBox4 = System.Windows.Forms.ComboBox() self._button5 = System.Windows.Forms.Button() self._button6 = System.Windows.Forms.Button() self._comboBox5 = System.Windows.Forms.ComboBox() self._comboBox6 = System.Windows.Forms.ComboBox() self.SuspendLayout() # # comboBox1 # self._comboBox1.FormattingEnabled = True self._comboBox1.Location = System.Drawing.Point(23, 34) self._comboBox1.Name = "comboBox1" self._comboBox1.Size = System.Drawing.Size(171, 21) self._comboBox1.TabIndex = 2 self._comboBox1.SelectedIndexChanged += self.ComboBox1SelectedIndexChanged # # comboBox2 # self._comboBox2.FormattingEnabled = True self._comboBox2.Location = System.Drawing.Point(214, 34) self._comboBox2.Name = "comboBox2" self._comboBox2.Size = System.Drawing.Size(171, 21) self._comboBox2.TabIndex = 3 # # button1 # self._button1.Location = System.Drawing.Point(402, 34) self._button1.Name = "button1" self._button1.Size = System.Drawing.Size(75, 23) self._button1.TabIndex = 4 self._button1.Text = "Thêm" self._button1.UseVisualStyleBackColor = True # # button2 # self._button2.Location = System.Drawing.Point(483, 34) self._button2.Name = "button2" self._button2.Size = System.Drawing.Size(75, 23) self._button2.TabIndex = 5 self._button2.Text = "Xóa" self._button2.UseVisualStyleBackColor = True # # button3 # self._button3.Location = System.Drawing.Point(483, 63) self._button3.Name = "button3" self._button3.Size = System.Drawing.Size(75, 23) self._button3.TabIndex = 9 self._button3.Text = "Xóa" self._button3.UseVisualStyleBackColor = True # # button4 # self._button4.Location = System.Drawing.Point(402, 63) self._button4.Name = "button4" self._button4.Size = System.Drawing.Size(75, 23) self._button4.TabIndex = 8 self._button4.Text = "Thêm" self._button4.UseVisualStyleBackColor = True # # comboBox3 # self._comboBox3.FormattingEnabled = True self._comboBox3.Location = System.Drawing.Point(214, 63) self._comboBox3.Name = "comboBox3" self._comboBox3.Size = System.Drawing.Size(171, 21) self._comboBox3.TabIndex = 7 # # comboBox4 # self._comboBox4.FormattingEnabled = True self._comboBox4.Location = System.Drawing.Point(23, 63) self._comboBox4.Name = "comboBox4" self._comboBox4.Size = System.Drawing.Size(171, 21) self._comboBox4.TabIndex = 6 # # button5 # self._button5.Location = System.Drawing.Point(483, 90) self._button5.Name = "button5" self._button5.Size = System.Drawing.Size(75, 23) self._button5.TabIndex = 13 self._button5.Text = "Xóa" self._button5.UseVisualStyleBackColor = True # # button6 # self._button6.Location = System.Drawing.Point(402, 90) self._button6.Name = "button6" self._button6.Size = System.Drawing.Size(75, 23) self._button6.TabIndex = 12 self._button6.Text = "Thêm" self._button6.UseVisualStyleBackColor = True # # comboBox5 # self._comboBox5.FormattingEnabled = True self._comboBox5.Location = System.Drawing.Point(214, 90) self._comboBox5.Name = "comboBox5" self._comboBox5.Size = System.Drawing.Size(171, 21) self._comboBox5.TabIndex = 11 # # comboBox6 # self._comboBox6.FormattingEnabled = True self._comboBox6.Location = System.Drawing.Point(23, 90) self._comboBox6.Name = "comboBox6" self._comboBox6.Size = System.Drawing.Size(171, 21) self._comboBox6.TabIndex = 10 # # MainForm # self.ClientSize = System.Drawing.Size(575, 284) self.Controls.Add(self._button5) self.Controls.Add(self._button6) self.Controls.Add(self._comboBox5) self.Controls.Add(self._comboBox6) self.Controls.Add(self._button3) self.Controls.Add(self._button4) self.Controls.Add(self._comboBox3) self.Controls.Add(self._comboBox4) self.Controls.Add(self._button2) self.Controls.Add(self._button1) self.Controls.Add(self._comboBox2) self.Controls.Add(self._comboBox1) self.Name = "MainForm" self.Text = "thu" self.Load += self.MainFormLoad self.ResumeLayout(False)
def ComboBox1SelectedIndexChanged(self, sender, e): pass