本文整理汇总了C#中System.Windows.Controls.TextBox.ScrollToEnd方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.ScrollToEnd方法的具体用法?C# TextBox.ScrollToEnd怎么用?C# TextBox.ScrollToEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.TextBox
的用法示例。
在下文中一共展示了TextBox.ScrollToEnd方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoggedTextBox
public LoggedTextBox(TextBox textBox)
{
string outputDir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\BenchmarkApplication\";
var df = new DirectoryInfo(outputDir);
if (! df.Exists)
{
df = Directory.CreateDirectory(df.FullName);
}
string fileName = string.Format(df.FullName + "BenchmarkApplication{0}.log", DateTime.Now.ToFileTime());
var logFile = new FileStream(fileName, FileMode.Append, FileAccess.Write, FileShare.None);
this.streamWriter = new StreamWriter(logFile);
this.textBox = textBox;
this.appendText = delegate(string text)
{
textBox.AppendText(text);
textBox.ScrollToEnd();
textBox.Focus();
};
}
示例2: AppendToInfoBox
private void AppendToInfoBox(TextBox e, String appendedText)
{
if (this.Dispatcher.Thread == Thread.CurrentThread)
{
e.AppendText(appendedText);
e.ScrollToEnd();
}
else
{
this.Dispatcher.Invoke(new SingleStringDelegate(AppendToInfoBox), e, appendedText);
}
}
示例3: handleRequest
//.........这里部分代码省略.........
if (len == 1)
{
showscreen.getNamyong().sayKeyword(showscreen.getNamyong().balloon);
showscreen.getDaddy().sayKeyword( showscreen.getDaddy().balloon);
}
//talk n은 남용이에게 말걸기
else if (len == 2 && ssize[1].Equals("n"))
showscreen.getNamyong().sayKeyword(showscreen.getNamyong().balloon);
//time d는 아버지에게 말걸기
else if (len == 2 && ssize[1].Equals("d"))
showscreen.getDaddy().sayKeyword(showscreen.getDaddy().balloon);
}
//introduce를 처음에 입력받음
else if (ssize[0].Equals("introduce"))
{
//그냥 introduce는 둘 다에게 말걸기
if (len == 1)
{
showscreen.getNamyong().introduce();
showscreen.getDaddy().introduce();
}
//introduce n은 남용이에게 말걸기
else if (len == 2 && ssize[1].Equals("n"))
showscreen.getNamyong().introduce();
//introduce d는 아버지에게 말걸기
else if (len == 2 && ssize[1].Equals("d"))
showscreen.getDaddy().introduce();
}
//computer를 처음에 입력받음
else if (ssize[0].Equals("computer"))
{
//그냥 computer는 둘 다에게 말걸기
if (len == 1)
{
showscreen.getNamyong().sayaboutCom();
showscreen.getDaddy().sayaboutCom();
}
//computer n은 남용이에게 말걸기
else if (len == 2 && ssize[1].Equals("n"))
showscreen.getNamyong().sayaboutCom();
//computer d는 아버지에게 말걸기
else if (len == 2 && ssize[1].Equals("d"))
showscreen.getDaddy().sayaboutCom();
}
//board 입력
else if(ssize[0].Equals("board") && len == 1)
{
showscreen.getBoard().openBoardWindow();
}
//product 입력
else if (ssize[0].Equals("product") && len == 1)
{
showscreen.getMall().openMallWindow();
}
//help 입력
else if(ssize[0].Equals("help") && len == 1)
{
showscreen.getMWinReference().OpenHelpWindow();
}
//about 입력
else if (ssize[0].Equals("about") && len == 1)
{
showscreen.getMWinReference().openAboutWIndow();
}
//exit 입력
else if (ssize[0].Equals("exit") && len == 1)
{
showscreen.getMWinReference().exitNamyongNDaddy();
}
//reload 입력
else if (ssize[0].Equals("reload") && len == 1)
{
showscreen.getMWinReference().reloadScreen();
}
msgbox.ScrollToEnd();
}
示例4: printMSG
public void printMSG(TextBox msgbox, string msg)
{
if (msg.Equals("")) return;
msgbox.Text += (msg + "\n");
msgbox.ScrollToEnd();
}
示例5: AppendLineToTextBox
public static void AppendLineToTextBox(TextBox textBox, string message)
{
textBox.AppendText(message + Environment.NewLine);
if (textBox.Text.Length > 12000)
{
string text = textBox.Text;
text = text.Substring(text.Length - 10000, 10000);
int index = text.IndexOf(Environment.NewLine);
if (index != -1)
{
text = text.Substring(index + Environment.NewLine.Length);
}
textBox.Text = text;
}
textBox.CaretIndex = textBox.Text.Length;
textBox.ScrollToEnd();
}
示例6: HistoryTextChanged
public void HistoryTextChanged(TextBox item)
{
item.ScrollToEnd();
}