Hallo,
die Eigenschaft 'RightToLeft' ist für Sprachen gedacht, welche eine Leserichtung von Rechts nach Links haben (z.B. Arabisch oder Hebräisch) und nicht für rechtsbündige Formatierung.
Und daher wandern auch die Buttons nach rechts, wenn du diese Eigenschaft aktivierst.
Um Text rechtsbündig in einer ComboBox darzustellen, mußt du den Text selber zeichnen (lassen):
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
| comboBox.DrawMode = DrawMode.OwnerDrawFixed; comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
void comboBox_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground();
string txt = ""; if (e.Index >= 0) txt = comboBox.Items[e.Index].ToString();
TextRenderer.DrawText(e.Graphics, txt, e.Font, e.Bounds, e.ForeColor, TextFormatFlags.Right); e.DrawFocusRectangle(); } |