How can I drag file names from Windows Explorer and drop them into a listbox

Place a ListBox on your form, set its AllowDrop property and handle both DragEnter and DragDrop as below. private void listBox1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.All; else e.Effect = DragDropEffects.None; } private void listBox1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { string[] files = (string[])e.Data.GetData(‘FileDrop’, false); foreach (string s in files) { //just filename listBox1.Items.Add(s.Substring(1 + s.LastIndexOf(@’\’))); //or fullpathname // listBox1.Items.Add(s); } }

How can I make a control occupy all the client area of a form

private void Form1_Load(object sender, System.EventArgs e) { Bitmap newBmp = new Bitmap(100, 100); Graphics g = Graphics.FromImage(newBmp); g.FillRectangle(new SolidBrush(Color.Red), 0, 0, 33, 100); g.FillRectangle(new SolidBrush(Color.White), 34, 0, 33, 100); g.FillRectangle(new SolidBrush(Color.Blue), 68, 0, 33, 100); pictureBox1.Image = newBmp; //pictureBox1 was dropped on the form }

How do I implement an owner drawn combobox

You can subclass ComboBox. In your derived class, make sure you set this.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.DropDownStyle = ComboBoxStyle.DropDownList; You also need to handle the DrawItem event to actually implement the drawing. Check out the details in the OwnerDrawnComboBox sample.