Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
i dont know how to bold a specific item in list box(Forms List Box) as bold in VB.net
Please help me out.

Thanks in advance,
Karthikesan
Posted
Updated 3-Jul-11 21:40pm
v2
Comments
Sergey Alexandrovich Kryukov 4-Jul-11 3:29am    
Which list box? WPF, Forms, ASP.NET? If you know only one, it does not mean others should do guesswork.
--SA
Member 3956257 4-Jul-11 3:40am    
Forms List Box.
Sergey Alexandrovich Kryukov 4-Jul-11 3:50am    
OK, now tag it! This is in your interest.
--SA

1 solution

You can easily do it in WPF, as each ListItem can get any Content and can be any type, not only ListItem. In particular, you can use TextBlock for Content, so each instance of the TextBlock can get different font in different items of the list box.

This is not the case with System.Windows.Forms.ListBox. Items can also be of any type, but they are rendered in the same way. What you see in the item on screen is rendered as the value returned by the method object.ToString. This string is always rendered with the same font which is the property of an instance of the class ListBox. A whole list, not individual item. Same thing about ASP.NET, System.Web.UI.WebControls.ListBox, to best of my knowledge.

You can find find the code samples with WPF list views and individual list item properties in most of my CodeProject articles (except the last one).

—SA
 
Share this answer
 
v2

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