// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Drawing; using System.Windows.Forms; namespace DefaultNamespace { public class MainForm : Form { private ComboBox comboBox1; public MainForm() { InitializeComponent(); } [STAThread] public static void Main(string[] args) { Application.Run(new MainForm()); } private void InitializeComponent() { comboBox1 = new ComboBox(); SuspendLayout(); comboBox1.Location = new System.Drawing.Point(50, 50); comboBox1.Size = new System.Drawing.Size(150, 25); string[] noget = { "", "A", "BB", "CCC" }; for(int i = 0; i < noget.Length; i++) { comboBox1.Items.Add(noget[i]); } ClientSize = new Size(250, 400); Controls.Add(comboBox1); Text = "Combobox test"; ResumeLayout(false); } } }