Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello

I have one textbox, one button and one listbox... I want to do this: When i add some text into textbox, and that text is allrady existing in listbox, a want to change font and bold that item in listbox... Can someone help me????

Or this: I want to add green dot to text in listbox which are matching in textbox???

C#
private void button1_Click(object sender, EventArgs e)
    { 
    if (listBox1.Items.Contains(textBox1.Text) == false)
    {
        listBox1.Items.Add(textBox1.Text);
    }
    else
    {
        MessageBox.Show("It's allrady in listbox");
        //need to change font and bold that item in listbox
        //or add green dot to text in listbox
    }
}
Posted
Updated 2-Jun-11 10:13am
v2

1 solution

What a coincidence! Even I was learning how to change the font. Its so easy to do in WPF but in Windows Forms it requires more effort.
However I found a link which might help you(and help me too!):
http://social.msdn.microsoft.com/forums/en-US/Vsexpressvcs/thread/b09c5c20-4b5f-4d42-954c-e4383b2bf0ec[^]

Good luck! :thumbsup:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900