R
Roberto Rocco
Hello,
After you add a list item to the ListBoxEx the font of the item changes!
I need a ListBox where the items shall have different fonts.
Therefore I set the font of the items e.g. like this:
OpenNETCF.Windows.Forms.ListItem item = new
OpenNETCF.Windows.Forms.ListItem();
item.Font = new System.Drawing.Font ("Microsoft Sans Serif", 16.0F,
System.Drawing.FontStyle.Bold);
listBoxEx1.Items.Add (item); // Hey! My font has changed!!!
But after adding the list item to the ListBoxEx the font of the item I
previously set changes! (line 3 in the sample code above)
Of course I could set all the list item fonts AFTER adding the items to the
list, but this would be a rather tedious task, especially because I want to
have my own ListItem Class derived from OpenNETCF.Windows.Forms.ListItem and
I want to set the item font inside the constructor of this derived class as
this:
listBoxEx1.Items.Add(new MyListItem (MyFontSize);
Is there any special reason for this strange behaviour or is it a known bug
inside the ListBoxEx class?
Many thanks in advance,
Roberto Rocco.
After you add a list item to the ListBoxEx the font of the item changes!
I need a ListBox where the items shall have different fonts.
Therefore I set the font of the items e.g. like this:
OpenNETCF.Windows.Forms.ListItem item = new
OpenNETCF.Windows.Forms.ListItem();
item.Font = new System.Drawing.Font ("Microsoft Sans Serif", 16.0F,
System.Drawing.FontStyle.Bold);
listBoxEx1.Items.Add (item); // Hey! My font has changed!!!
But after adding the list item to the ListBoxEx the font of the item I
previously set changes! (line 3 in the sample code above)
Of course I could set all the list item fonts AFTER adding the items to the
list, but this would be a rather tedious task, especially because I want to
have my own ListItem Class derived from OpenNETCF.Windows.Forms.ListItem and
I want to set the item font inside the constructor of this derived class as
this:
listBoxEx1.Items.Add(new MyListItem (MyFontSize);
Is there any special reason for this strange behaviour or is it a known bug
inside the ListBoxEx class?
Many thanks in advance,
Roberto Rocco.