当前位置: 首页>>代码示例>>C#>>正文


C# Control.Refresh方法代码示例

本文整理汇总了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();
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:25,代码来源:CollapsePanel.cs

示例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();
    }
开发者ID:verebes,项目名称:xml_form_editor,代码行数:8,代码来源:WindowsApiMethods.cs

示例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;

        }
    }
开发者ID:pichiliani,项目名称:CoPhysicsSimulator,代码行数:64,代码来源:AnimationEngine.cs

示例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);
                }
            }
        }
开发者ID:AlanFoster,项目名称:Game-of-Life,代码行数:15,代码来源:PlayerTab.cs

示例5: ResumeDrawing

 public static void ResumeDrawing(Control parent)
 {
     SendMessage(parent.Handle, WM_SETREDRAW, new IntPtr(1), IntPtr.Zero); parent.Refresh();
 }
开发者ID:iorihu2001,项目名称:MSChartExtension,代码行数:4,代码来源:WindowMessagesNativeMethods.cs

示例6: ResumeDrawing

 public static void ResumeDrawing(Control parent)
 {
     SendMessage(parent.Handle, WM_SETREDRAW, true, 0); parent.Refresh();
 }
开发者ID:pckujawa,项目名称:MSChartExtension,代码行数:4,代码来源:WindowMessagesNativeMethods.cs


注:本文中的Control.Refresh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。