我正在使用的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