hashtgerd2
یک شنبه 26 اردیبهشت 1395, 07:53 صبح
تو ریچ تکس باکس وقتی دکمه هارو میزنم هر حرف به رنگ خاصی به نمایش در میاد
ولی وقتی دکمه باتن اینتر رو می زنم همه نوشته ها یک دست یک رنگ میشن
140426
بعد از زدن باتن اینتر
140427
کلید اینتر خود کیبورد رو میزنی این مشکل رو نداره ولی دکمه رو میزنی این مشکل هست رنگ همه یکی میشه
کد مربوط به اینتر
// برای پاک کردن قسمت انتخاب شده
if (TextBox1.SelectionLength > 0)
TextBox1.SelectedText = "";
// برای بردن به خط جدید از جایی که کلیک شده است
string removedSelection = TextBox1.Text;
int selectionStartIndex = TextBox1.SelectionStart;
TextBox1.Text = removedSelection.Insert(selectionStartIndex, Environment.NewLine);
TextBox1.SelectionStart = selectionStartIndex + 1;
// TextBox1.Focus();
ولی وقتی دکمه باتن اینتر رو می زنم همه نوشته ها یک دست یک رنگ میشن
140426
بعد از زدن باتن اینتر
140427
کلید اینتر خود کیبورد رو میزنی این مشکل رو نداره ولی دکمه رو میزنی این مشکل هست رنگ همه یکی میشه
کد مربوط به اینتر
// برای پاک کردن قسمت انتخاب شده
if (TextBox1.SelectionLength > 0)
TextBox1.SelectedText = "";
// برای بردن به خط جدید از جایی که کلیک شده است
string removedSelection = TextBox1.Text;
int selectionStartIndex = TextBox1.SelectionStart;
TextBox1.Text = removedSelection.Insert(selectionStartIndex, Environment.NewLine);
TextBox1.SelectionStart = selectionStartIndex + 1;
// TextBox1.Focus();