文章出處

C#中一個RichTextBox,當新寫入內容時,超過當前顯示區域后,自動滾動到最低端,方便查看內容。

private void txtInfo_TextChanged(object sender, EventArgs e)
{
    txtInfo.SelectionStart = txtInfo.Text.Length; //Set the current caret position at the end
    txtInfo.ScrollToCaret(); //Now scroll it automatically
}

文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()