Browse by Tags
All Tags » ListBox » Using Controls (RSS)
Sorry, but there are no more tags available to filter with.
-
|
See Creating an Owner-Drawn Listbox on GotDotNet . It derives from Form and implements the owner drawing by handling the DrawItem event and MeasureItem event. You can also download a sample that implements an owner drawn listbox by deriving from ListBox...
|
-
|
The code below minimally handles D&D for a single selection list box by handling four events. The D&D is initiated in MouseDown if the user mouses down on the current selection. The DragEnter event is used to set the dragging effect to copy if...
|
-
|
You can iterate through the list to find the longest text extent using MeasureString, adding a fudge factor if the is present. using ( System.Drawing.Graphics g = listBox1.CreateGraphics() ) { float maxWidth = 0f; float height = 0f; for ( int i = 0; i...
|
-
|
Place a ListBox on your form, set its AllowDrop property and handle both DragEnter and DragDrop as below. private void listBox1_DragEnter( object sender, DragEventArgs e ) { if ( e.Data.GetDataPresent( DataFormats.FileDrop ) ) e.Effect = DragDropEffects...
|
-
|
You have to access the Items of the ListBox using the Items property and clear (or otherwise operate on the items) these. listBox1.Items.Clear(); Contributed from George Shepherd's Windows Forms FAQ
|
-
|
Check out Devinder Arora's article Using ListBox Control in C# on C# Corner . Contributed from George Shepherd's Windows Forms FAQ
|
-
|
The attached EditableList UserControl implements an editable ListBox with an in-place TextBox and Button allowing users to directly edit the contents of the list box. When the user clicks on a selected item, a textbox and a button is shown over the selected...
|