Title: Draw Simple Circle in List box in C#.Net Desktop Application
Tags: c#;winforms
Question: i want to draw simple circle of different category size of circle come form database and different size in c#.net for desktop for winforms ..
as you saw me how to draw circle using listbox now i want to fill color in List box each circle using another List box when color is defined ....it is multiple color also we can apply .. please help me in this..
Comment: OK, so what is your question?  Do you want someone to do it all for you, or have you tried something that didn't work?

Comment: First decide if you want a Desktop (WinForms or WPF) or Web application. The answer is very different for each of those three.

Comment: Please provide more detail on what you are trying to solve.  Try to provide concrete examples.  And, which part of your solution is giving you trouble (the drawing, the data access, etc.)?


Here is another answer: Set DrawMode property and handle DrawItem event of ListBox,
private void Form1_Load(object sender, EventArgs e)
{
listBox1.DrawMode = DrawMode.OwnerDrawVariable;
listBox1.Items.Add("One");
listBox1.Items.Add("Two");
listBox1.Items.Add("Three");
listBox1.DrawItem += new DrawItemEventHandler(listBox1_DrawItem);
}
void listBox1_DrawItem(object sender, DrawItemEventArgs e)
{
ListBox l=sender as ListBox;
e.DrawBackground();
e.DrawFocusRectangle();
e.Graphics.DrawEllipse(Pens.Blue, new Rectangle(1, 1+e.Index * 15, 100, 10));
e.Graphics.DrawString(l.Items[e.Index].ToString(), new Font(FontFamily.GenericSansSerif,9, FontStyle.Regular), Brushes.Red , e.Bounds);
}
Comment for this answer: vote down  star
Hi, i want to draw simple circle of different category size of circle come form database and different size in c#.net for desktop for winforms ..
as you saw me how to draw circle using listbox now i want to fill color in List box each circle using another List box when color is defined ....it is multiple color also we can apply .. please help me in this..

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 3, 'ContentLicense': 'CC BY-SA 2.5', 'CreationDate': '2009:00:09/07/09', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c#><winforms>', 'Title': 'Draw Simple Circle in List box in C#.Net Desktop Application', 'ViewCount': 2247, 'id': 1389557, 'user_AboutMe': '<p>Asp.Net MVC C# , Sql server Developer</p>\n', 'user_AccountId': 47298.0, 'user_DisplayName': 'Yagnesh84', 'user_Reputation': 157.0, 'user_Views': 117.0, 'user_id': 140040.0}}