看板 C_Sharp 關於我們 聯絡資訊
※ 引述《cole945 (躂躂..)》之銘言: : ※ 引述《cole945 (躂躂..)》之銘言: : : 目前.NET沒提供. 要不自己寫, 要不WinAPI有方法可以做.. : 歹勢我剛發現.NET2.0(vs2005)後就有提供了 囧 : int line = textBox1.GetLineFromCharIndex(textBox1.SelectionStart); : int col = textBox1.GetFirstCharIndexOfCurrentLine(); : Text = line + "," + (textBox1.SelectionStart - col); : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ : 這樣就可以了.. 不好意思~~~我是用richtextbox的 用這個語法 好像有錯誤 有其他方法嗎?? 謝謝 -- http://www.wretch.cc/blog/APee0509 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.217.141.175
cole945:錯誤訊息呢? 06/12 01:56
APee0509:他說richtextbox沒有定義 06/12 20:11
APee0509:GefGirstCharIndexOfCurrentLine 06/12 20:12
APee0509:抱歉是richtextbox不包含Get~~~~~的定義 06/12 20:12