waitcursormanager.cs

来自「vs 2005 中 用的 vb 示例 程序,测试运行良好,对初学者有一定参考价值」· CS 代码 · 共 43 行

CS
43
字号
//---------------------------------------------------------------------
//  This file is part of the Microsoft .NET Framework SDK Code Samples.
// 
//  Copyright (C) Microsoft Corporation.  All rights reserved.
// 
//This source code is intended only as a supplement to Microsoft
//Development Tools and/or on-line documentation.  See these other
//materials for detailed information regarding Microsoft code samples.
// 
//THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
//KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//PARTICULAR PURPOSE.
//---------------------------------------------------------------------
#region Using directives

using System;
using System.Windows.Forms;

#endregion

namespace Microsoft.Samples.Windows.Forms.EventBasedAsync
{
    
    internal class WaitCursorManager : IDisposable {

        private Form f = null;
        private Cursor stored = null;

        internal WaitCursorManager(Form f) {
            this.f = f;
            this.stored = f.Cursor;
            f.Cursor = Cursors.WaitCursor;
        }

        public void Dispose() {
            f.Cursor = stored;
            f = null;
            stored = null;
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?