这里是我的代码不能RichTextBox的中数行数
private void Allocation_Matrix_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
int Total_Row_Check;
Total_Row_Check = getRow();
Textbox1.Text = Convert.ToString(Total_Row_Check);
if (Total_Row_Check >= Convert.ToInt32(Total_Processes.Text))
{
MessageBox.Show("rows cannot exceed from total number of processess");
}
}
}
public int getRow()
{
int Row = 0;
string[] arLines;
int i;
arLines = Allocation_Matrix.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
for (i = 0; i < arLines.Length; i++)
{
Row++;
}
return Row;
}
我想更新TextBox1的我敲击回车键从键盘的RichTextBox ...但文本框只保留显示FIRSTROW并显示一( 1)
公众诠释GetRows的() { 串[] arLines; int i; arLines = Allocation_Matrix.Text.Split(new string [] {Environment.NewLine},StringSplitOptions.None);对于(i = 0; i
2010-12-03 06:00:09
上面的代码正在工作.....然后你错了:( – 2010-12-03 06:02:06