[英]TextBox RTL with letters and numbers
我将TextBox.RightToLeft
属性设置为Yes
。
当我输入以下文本时:“ a 32”,存储的字符串为“ 32 a”。 输入文本的顺序是:首先3 2然后是空格 ,然后是 。
如何保存输入的值?
如果在运行时更改RightToLeft属性的值,则仅保留未格式化的原始文本。
您将不得不自己颠倒其顺序:
string[] text = textBox1.Text.Split(new char[]{' '}, StringSplitOptions.RemoveEmptyEntries); //get string while preserving the words
Array.Reverse(text); //reverse the order of words (not their chars)
string finalValue = string.Join(" ", text); //make the string out of array
尝试这个:
设置您的TextBox属性RightToLeft = NO并使用TextAlign = Right。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.