Windows Develop Bookmark and Share   
 index > Windows Forms General > Listbox Professional Question
 

Listbox Professional Question

how to display text or numberinside a listbox using visual studio C# ??????????
Heri Tony  Thursday, October 01, 2009 6:29 AM
You can try with this..


namespace WindowsFormsApplication11
{
public partial class Form1 : Form
{
List<string> _items = new List<string>(); // <-- Add this

public Form1()
{
InitializeComponent();

_items.Add("One"); // <-- Add these
_items.Add("Two");
_items.Add("Three");

listBox1.DataSource = _items;
}
}
}
  • Marked As Answer byHeri Tony Tuesday, October 06, 2009 2:29 AM
  •  
Ganapatisb  Thursday, October 01, 2009 7:08 AM
And also you just go through this link.. May it helps you..

http://dotnetperls.com/listbox
  • Marked As Answer byHeri Tony Tuesday, October 06, 2009 2:29 AM
  •  
Ganapatisb  Thursday, October 01, 2009 7:10 AM
Do you mean adding Items to Listbox?
Tamer Oz  Thursday, October 01, 2009 6:34 AM
You can try with this..


namespace WindowsFormsApplication11
{
public partial class Form1 : Form
{
List<string> _items = new List<string>(); // <-- Add this

public Form1()
{
InitializeComponent();

_items.Add("One"); // <-- Add these
_items.Add("Two");
_items.Add("Three");

listBox1.DataSource = _items;
}
}
}
  • Marked As Answer byHeri Tony Tuesday, October 06, 2009 2:29 AM
  •  
Ganapatisb  Thursday, October 01, 2009 7:08 AM
And also you just go through this link.. May it helps you..

http://dotnetperls.com/listbox
  • Marked As Answer byHeri Tony Tuesday, October 06, 2009 2:29 AM
  •  
Ganapatisb  Thursday, October 01, 2009 7:10 AM

You can use google to search for other answers

Custom Search

More Threads

• Making text bold and italics.
• access remote files
• Windows Custom Controls
• Question about UI Thread Invoking
• Is it possible to use MFC classes in Windows Forms projects?
• Functions in Expressions
• Draw 30 PictureBoxes on a Form
• Combo box Problem in Dropdownlist style
• Automate BackSpace key
• Find Method for a richTextBox (Help Please)