C# wpf --- This is a "continuation" of c-sharpcorner.com/forums/how-do-i-set-listbox-item-font-to-bold.
C#
This does not change the font to bold.
C#
This, also, does not change the font to bold.
C# wpf --- This is a "continuation" of c-sharpcorner.com/forums/how-do-i-set-listbox-item-font-to-bold.
This does not change the font to bold.
This, also, does not change the font to bold.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Abhishek ChadhaRank #402 · 6.2K reputationPosted May 16, 2024, 1:51 PM EDT
You can try this programmatically in C#
using System.Windows; using System.Windows.Controls; namespace YourNamespace { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); // Call the method to set ListBox items font to bold SetListBoxItemFontBold(); } private void SetListBoxItemFontBold() { foreach (var item in gLBx.Items) { ListBoxItem listBoxItem = gLBx.ItemContainerGenerator.ContainerFromItem(item) as ListBoxItem; if (listBoxItem != null) { listBoxItem.FontWeight = FontWeights.Bold; } } } } }Sam HobbsRank #107 · 20.5K reputationPosted May 16, 2024, 2:04 PM EDT
It is better to continue with the original question. I posted a responce there that I think solves the problem.