本文整理汇总了C#中Control.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# Control.Refresh方法的具体用法?C# Control.Refresh怎么用?C# Control.Refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control.Refresh方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CollapsePanel
public CollapsePanel(Manager manager, Control parent, string Name, int expandedHeight = 100, bool extended = true)
{
this.panel = new GroupPanel(manager);
panel.Init();
panel.Height = expandedHeight;
panel.Width = parent.Width - 20;
panel.Resizable = true;
//panel.Text = " " + Name.Trim();
Text = Name;
this.collapseButton = new Button(manager);
collapseButton.Init();
collapseButton.Width = 15;
collapseButton.Height = 18;
collapseButton.Text = "^";
collapseButton.Click += collapseButton_Click;
this.ExpandedHeight = expandedHeight;
this.panelControls = new Dictionary<string, Control>();
this.parent = parent;
parent.Add(panel);
parent.Add(collapseButton);
this.IsExtended = extended;
parent.Refresh();
}
示例2: ResumeDrawing
public static void ResumeDrawing(Control c)
{
if (c == null)
throw new ArgumentNullException("c");
WindowsApiMethods.SendMessage(c.Handle, (Int32)WM_SETREDRAW, (Int32)1, (Int32)0);
c.Refresh();
}
示例3: Start
public void Start(MagicDocument doc, Control wnd)
{
// System.Threading.Thread.CurrentThread.Priority = System.Threading.ThreadPriority.Lowest;
this.doc = doc;
this.wnd = wnd;
running = true;
paused= false;
// Mark any object that is initially at rest if it overlaps with something
// anchored or something else at rest.
MarkInitialAtRest();
// Testes de pause
// int pause = 0;
int then = Environment.TickCount-50;
Application.DoEvents();
while (running)
{
// Relax the CPU if we're running better than 20fps (50ms); also
// guard against any period longer than 50ms.
int now = Environment.TickCount;
if (now-then < 50)
{
int delay = 50 - (now-then);
delay -= delay%10;
if (delay > 0)
{
Application.DoEvents();
System.Threading.Thread.Sleep(delay);
}
}
while(paused)
{
Application.DoEvents();
System.Threading.Thread.Sleep(5);
then = now;
}
// Run the engine for 50 milliseconds before refresh.
Tick(50);
// Render the new frame of animation.
wnd.Refresh();
// Service the message queue.
Application.DoEvents();
/// System.Diagnostics.Debug.WriteLine(Global.clienteEnvia.tClienteRecebe.ThreadState.ToString());
// Application.Run();
// System.Threading.ManualResetEvent
// Continue.
then = now;
continue;
}
}
示例4: Resize
private void Resize(Control parent, int size)
{
if (parent.Name != IgnoreString)
{
parent.Height = size;
parent.MinimumHeight = size;
parent.MaximumHeight = size;
parent.Refresh();
foreach (var child in parent.Controls)
{
Resize(child, size);
}
}
}
示例5: ResumeDrawing
public static void ResumeDrawing(Control parent)
{
SendMessage(parent.Handle, WM_SETREDRAW, new IntPtr(1), IntPtr.Zero); parent.Refresh();
}
示例6: ResumeDrawing
public static void ResumeDrawing(Control parent)
{
SendMessage(parent.Handle, WM_SETREDRAW, true, 0); parent.Refresh();
}