I have this code to create a listbox on my Menu.xaml code behind (Menu.xaml.vb):
Dim mm as new ListBox()
mm.FontSize=20
mm.Items.add("Notifications:")
For Each Row as DataRow in mydt.Rows
mm.Items.add(Row("name"))
Next
The code works great and I can see the list box but what I want is to style each listbox item. For example I want the first one with fontsize=24, fontbold, backcolor=black, font color white and the rest with fontsize=16
There is no listbox on the xaml, it is created and painted by code.
Any help or clue?
Thanks in advance
You could explicitly create a ListBoxItem for every item and set all necessary properties. In C# it may look like shown below (sorry, i don’t speak VB).