December 28th, 2011, 03:15 PM
ComboBox RightToLeft and TextAlign
Hi, I'm playing around with a combobox and having a little issue with the items in it.
I intend for the CB to be just the size of the down-arrow, and to expand (the size, not the pulldownitems) itself on mouse_enter event. That works fine, but for the standart default CB, the down-arrow would move to the far right end of the control when I resize it on mouse_enter. So I would need to move the mouse to the end to click on the arrow and open it's items.
Now, I found out that the RightToLeft = Yes property will make the down-arrow stay on the far left side of the control when resizing, but at the cost of my strings being... em, RightToLefted...?
So I thought omg I'm so much smarter than you, I'll just invert my string!! Big surprise when I found out that for my string it always gave the same result!
string sample = intVariable.ToString("00") + " times";
string sample = "times " + intVariable.ToString("00");
will both add an item with text "times 01"
Maybe RightToLeft will perform more analisys on the string and apply cultural formats?
string sample = "every " + intVariable.ToString("00") + " times"; // works
string sample = "- " + intVariable.ToString("00") + " times"; // doesn't
MSDN RightToLeft article says that only text alignment for CBs will be affected, but little about how the strings are to be treated.
Not that I'm going into any developers crisis, but I just found it curious... If only I'd have a .TextAlign property!
December 31st, 2011, 01:35 AM
Re: ComboBox RightToLeft and TextAlign
Maybe this article will help you :
Extending the ComboBox with C#
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!