⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imagebutton.cs

📁 C#实现DHTML编辑器功能!
💻 CS
字号:
// DINAMIC XML Editor
//
// Copyright (c) 2002-2003 Dusan Hlavaty
// mailto: duddo@atlas.cz
//
// This software is licensed under the terms of
// GNU General Public license
//
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;
using System.ComponentModel;

namespace XML_editor.MyComponents
{
	/// <summary>
	/// Komponenta tlacidlo, ktora zobrazuje obrazok a nemoze dostat focus. Da
	/// sa iba stlacat.
	/// </summary>
	[ToolboxBitmap(typeof(Button))]
	[DefaultProperty("FlatStyle")]
	public class ImageButton : Button
	{
		// -------------------------------------------------------------------------
		/// <summary>
		/// Inicializuje instanciu triedy <see cref="ImageButton"/>
		/// </summary>
		public ImageButton()
		{
			InternalConstruct();
		}

		// -------------------------------------------------------------------------
		/// <summary>
		/// Interna inicializacna metoda
		/// </summary>
		private void InternalConstruct()
		{
			// Should not be allowed to select this control
			SetStyle(ControlStyles.Selectable, false);

			ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
			FlatStyle = FlatStyle.Flat;

		}

		// -------------------------------------------------------------------------
		/// <summary>
		/// Nastavi defaultnu velkost komponente - tak ako je odporucane
		/// v dokumentacii .NET
		/// </summary>
		protected override Size DefaultSize 
		{
			//			.NET docs:
			//			In order to maintain better performance,
			//			you should not set the Size of a control
			//      in its constructor. The preferred method
			//			is to override the DefaultSize property.
			get 
			{
				return new Size(20, 20);
			}
		}

	} // public class ImageButton : ...
} // namespace XML_editor.MyComponents

⌨️ 快捷键说明

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