我正在使用的Windows窗体应用程序使用RichtextBox
,Menustrip
和更多的控件。将当前光标位置显示为当前行和当前列?
我已经做了一些工作,但不能得到它的工作。当我的鼠标光标在RichTextBox中移动时,我想自动更改位置,就像简单的记事本上那样。
我的位编码是....
我想它所以当我的鼠标光标移动它改变了我的状态栏上的动态位置
private void sizeToolStripMenuItem_Click(object sender, EventArgs e)
{
int line = richTextBox1.GetLineFromCharIndex(richTextBox1.SelectionStart);
int column = richTextBox1.SelectionStart - richTextBox1.GetFirstCharIndexFromLine(line);
toolStripStatusLabel5.Text ="Line"+" "+ line.ToString();
toolStripStatusLabel6.Text = " Column" + " " + line.ToString();
toolStripStatusLabel3.Text= Cursor.Position.ToString(); // where is my mouse cursor at this Time like that x and y cordinate 330,334
}
您能分享一下MouseMove编码吗 – 2013-02-28 22:31:59