clsstaticexample.cs

来自「Sams Teach Yourself C# Web Programming i」· CS 代码 · 共 40 行

CS
40
字号
using System;

namespace Static_Methods
{
	/// <summary>
	/// Summary description for clsStaticExample.
	/// </summary>
	public class clsStaticExample
	{
		public clsStaticExample()
		{			
		//
			// TODO: Add constructor logic here
			//
		}
		public static void DrawEllipse(System.Windows.Forms.Form frm)
		{
			System.Drawing.Graphics objGraphics;
			System.Drawing.Rectangle recDrawRectangle;
			recDrawRectangle = frm.DisplayRectangle;
			recDrawRectangle.Inflate(-5, -5);
			objGraphics = frm.CreateGraphics();
			objGraphics.Clear(System.Drawing.SystemColors.Control);
			objGraphics.DrawEllipse(System.Drawing.Pens.Blue, recDrawRectangle);
			objGraphics.Dispose();

		}
		public static void ClearEllipse(System.Windows.Forms.Form frm)
		{
			frm.Refresh();
		}
		public static int ComputeLength(string strText)
		{
			return strText.Length;
		}


	}
}

⌨️ 快捷键说明

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