本文整理汇总了C#中System.Windows.Forms.TextBox.Invalidate方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.Invalidate方法的具体用法?C# TextBox.Invalidate怎么用?C# TextBox.Invalidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TextBox
的用法示例。
在下文中一共展示了TextBox.Invalidate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateTextBox
private void UpdateTextBox(TextBox txt, string data)
{
if (data == null) return;
txt.AppendText(data);
txt.SelectionStart = txt.TextLength;
txt.ScrollToCaret();
txt.Invalidate();
Application.DoEvents();
}
示例2: SetText
private void SetText(TextBox tbControl, string text)
{
// InvokeRequired required compares the thread ID of the
// calling thread to the thread ID of the creating thread.
// If these threads are different, it returns true.
if (tbControl.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(SetText);
this.Invoke(d, new object[] { tbControl,text });
}
else
{
tbControl.Text = text;
tbControl.Invalidate();
}
}
示例3: UpdatePreview
protected override void UpdatePreview(TextBox previewBox, object ruleObject)
{
RuleExpressionCondition declarativeRuleDefinition = ruleObject as RuleExpressionCondition;
if (declarativeRuleDefinition != null && declarativeRuleDefinition.Expression != null)
{
RuleExpressionCondition ruleExpressionCondition = new RuleExpressionCondition(declarativeRuleDefinition.Expression);
NativeMethods.SendMessage(previewBox.Handle, NativeMethods.WM_SETREDRAW, IntPtr.Zero, IntPtr.Zero);
previewBox.Lines = ruleExpressionCondition.ToString().Split('\n');
NativeMethods.SendMessage(previewBox.Handle, NativeMethods.WM_SETREDRAW, new IntPtr(1), IntPtr.Zero);
previewBox.Invalidate();
}
else
{
previewBox.Text = string.Empty;
}
}
示例4: UpdatePreview
protected override void UpdatePreview(TextBox previewBox, object ruleObject)
{
RuleSet ruleSet = ruleObject as RuleSet;
NativeMethods.SendMessage(previewBox.Handle, NativeMethods.WM_SETREDRAW, IntPtr.Zero, IntPtr.Zero);
previewBox.Lines = DesignerHelpers.GetRuleSetPreview(ruleSet).Split('\n');
NativeMethods.SendMessage(previewBox.Handle, NativeMethods.WM_SETREDRAW, new IntPtr(1), IntPtr.Zero);
previewBox.Invalidate();
}
示例5: 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();
}
示例6: UpdatePreview
protected override void UpdatePreview(TextBox previewBox, object ruleObject)
{
RuleSet ruleSet = ruleObject as RuleSet;
System.Workflow.Activities.Common.NativeMethods.SendMessage(previewBox.Handle, 11, IntPtr.Zero, IntPtr.Zero);
previewBox.Lines = DesignerHelpers.GetRuleSetPreview(ruleSet).Split(new char[] { '\n' });
System.Workflow.Activities.Common.NativeMethods.SendMessage(previewBox.Handle, 11, new IntPtr(1), IntPtr.Zero);
previewBox.Invalidate();
}