c#中控件重绘(放大缩小移动隐藏恢复后不消失)实例
生活随笔
收集整理的這篇文章主要介紹了
c#中控件重绘(放大缩小移动隐藏恢复后不消失)实例
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
//很重要,一定要重寫并在在OnPaint()中用傳入的pevent.Graphics重繪,并且屏蔽掉父類的OnPaint方法,這樣重繪后的圖形不論控件怎么操作都不會(huì)消失了
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;namespace GMFast.UI.UserControls
{
public class EllipseButton:Button
{
//public class A
// {
// public int a = 9;
// }
// A a = new A();
// int b = a.a; //字段屬性無法引用非靜態(tài)屬性、字段、方法
public EllipseButton()
{
//this.BackColor = Color.FromArgb(255, 255, 254);
}
public ColorStatus _colorStatus=ColorStatus.Empty;
public ColorStatus colorStatus
{
get
{
return _colorStatus;
}
set
{
總結(jié)
以上是生活随笔為你收集整理的c#中控件重绘(放大缩小移动隐藏恢复后不消失)实例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: springCloud - 第5篇 -
- 下一篇: 解决:Error response fr