本文整理汇总了C#中System.Windows.Forms.TextBox.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.Refresh方法的具体用法?C# TextBox.Refresh怎么用?C# TextBox.Refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TextBox
的用法示例。
在下文中一共展示了TextBox.Refresh方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddLogEntry
public void AddLogEntry(string message,string thread)
{
if (!threadTabs.ContainsKey(thread))
{
TabPage tab = new TabPage();
tab.Location = new System.Drawing.Point(4, 22);
tab.Name = "tab" + thread.Trim().Replace(' ', '_');
tab.Padding = new System.Windows.Forms.Padding(3);
tab.Size = new System.Drawing.Size(859, 226);
tab.Text = thread;
tab.UseVisualStyleBackColor = true;
threadTabs[thread] = tab;
tabControl1.TabPages.Add(tab);
TextBox txtLogBox = new TextBox();
txtLogBox.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
txtLogBox.Location = new System.Drawing.Point(6, 6);
txtLogBox.Multiline = true;
txtLogBox.Name = "txtLogBox";
txtLogBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
txtLogBox.Size = new System.Drawing.Size(847, 214);
txtLogBox.TabIndex = 1;
tab.Controls.Add(txtLogBox);
txtLogBox.Text += "[" + DateTime.Now.ToLongTimeString() + "] - " + message + Environment.NewLine;
txtLogBox.SelectionStart = txtLogBox.Text.Length;
txtLogBox.ScrollToCaret();
txtLogBox.Refresh();
}
else
{
TabPage tab = threadTabs[thread];
TextBox txtLogBox = (TextBox) tab.Controls[0];
txtLogBox.Text += "[" + DateTime.Now.ToLongTimeString() + "] - " + message + Environment.NewLine;
txtLogBox.SelectionStart = txtLogBox.Text.Length;
txtLogBox.ScrollToCaret();
txtLogBox.Refresh();
}
/*
txtLogBox.Text += "[" + DateTime.Now.ToLongTimeString() + "] - " + message + Environment.NewLine;
txtLogBox.SelectionStart = txtLogBox.Text.Length;
txtLogBox.ScrollToCaret();
txtLogBox.Refresh();
*/
}
示例2: CheckDateFormat
private void CheckDateFormat(TextBox Box)
{
switch (Box.Text.Length)
{
case 2:
Box.Text += ".";
Box.SelectionStart = Box.TextLength;
Box.ScrollToCaret();
Box.Refresh();
break;
case 5:
Box.Text += ".";
Box.SelectionStart = Box.TextLength;
Box.ScrollToCaret();
Box.Refresh();
break;
case 10:
DateTime Test = new DateTime();
if (!DateTime.TryParse(Box.Text, out Test))
{
AddProfileErrorProvider.SetError(Box, "Invalid date format \nThe date must be in the format (dd.mm.yyyy) \nand contain only numbers included in the date range");
}
else
{
AddProfileErrorProvider.Clear();
}
break;
}
}
示例3: TAC_CreateFontLibrary
//将字体以指定像素画到屏幕上,再从屏幕上取点得到字体点阵信息
//按照一定的顺序写入二进制文件,以此制成字库文件
//写的有问题,还是得改一改
private static void TAC_CreateFontLibrary(TextBox tbFont, int nFontHeight, int nFontWidth, int nLines, int nClos, String sFontName)
{
//直接产生GBK字库文件
//这是在PC端用的
Encoding GBK = Encoding.GetEncoding("GBK");
int nPerWordByte = (nFontWidth + 7) / 8 * nFontHeight;
int nPerPageByte = nPerWordByte * nLines * nClos;
byte[] barWriteFontDataBuffer = new byte[nPerPageByte * 0x7e];
byte[] GbkBytes = new byte[nLines * nClos * 2];
int bufferOffeset = 0;
for (int ch = 0x81; ch <= 0xfe; ch++)
{
int k = 0;
for (int cl = 0x40; cl <= 0xff; cl++)
{
GbkBytes[k++] = (byte)ch;
GbkBytes[k++] = (byte)cl;
}
byte[] RealGbkBytes = Encoding.Convert(GBK, Encoding.Default, GbkBytes);
String strPageText = Encoding.Default.GetString(TAC_ReplaceQuesToDoubleBlank(RealGbkBytes));
tbFont.Text = strPageText;
tbFont.Refresh();
byte[][] tbFontBitData = TAC_TurnTextBoxToPix(tbFont);
byte[] temp = TAC_CutToGridAndTurnToByte(tbFontBitData, nFontHeight, nFontWidth, nLines, nClos);
temp.CopyTo(barWriteFontDataBuffer, bufferOffeset);
bufferOffeset += nPerPageByte;
}
FileStream wFileStream = new FileStream(sFontName, FileMode.Create);
wFileStream.Write(barWriteFontDataBuffer, 0, barWriteFontDataBuffer.Length);
wFileStream.Close();
}
示例4: HELPER_updateTextBox
/// <summary>
/// Will update Text in a Text Box when the UI thread is still busy
/// </summary>
/// <param name="myTextBox">The TextBox control to update</param>
/// <param name="myText">The Text to update</param>
private void HELPER_updateTextBox(TextBox myTextBox, string myText)
{
myTextBox.Text = myText;
myTextBox.Invalidate();
myTextBox.Update();
myTextBox.Refresh();
Application.DoEvents();
}
示例5: ScrollTextBox
/// <summary>
/// Scrolls the text box.
/// </summary>
/// <param name="textBox">The text box.</param>
private void ScrollTextBox(TextBox textBox)
{
textBox.SelectionStart = textBox.Text.Length;
textBox.ScrollToCaret();
textBox.Refresh();
}
示例6: AddResult
private void AddResult(string Result, TextBox tbx_Target)
{
tbx_Target.Text += Result;
tbx_Target.Text += "\r\n";
tbx_Target.Focus();
tbx_Target.Select(tbx_OBOM_Result.TextLength, 0);
tbx_Target.ScrollToCaret();
tbx_Target.Refresh();
}
示例7: UpdateConsole
private void UpdateConsole(TextBox con,
string message,
params object[] args)
{
if (args == null)
con.Text += message + "\r\n";
else
con.Text += String.Format(message, args) + "\r\n";
con.SelectionStart = con.Text.Length;
con.ScrollToCaret();
con.Refresh();
}
示例8: ClearConsole
private void ClearConsole(TextBox con)
{
con.Text = String.Empty;
con.Refresh();
}