首页 > 编程知识 正文

前景色和背景色的作用,enabled属性false

时间:2023-05-06 06:16:20 阅读:10647 作者:3317

1 .公共方法

公共类mytextbox : textbox

{ protectedoverridevoidonenabledchanged (eventargs e )

{base.onenabledchanged(e; 启用为False时设置if(this.enabled )

{ this .SetStyle (深荔枝,false );

} else this .SetStyle (深荔枝,true ); 重新绘制this .Invalidate (;

//绘制textboxprotectedoverridevoidonpaint (painteventargse )

{base.onpaint(e;

system.drawing.brushb=new system.drawing.solid brush (this.forecolor );

string格式SF=new string格式(;

SF.line alignment=string alignment.center;

SF.alignment=string alignment.center; //绘制字符串//e.graphics.drawstring (this.text,this.Font,b,- 1,1 ); e.graphics.drawstring (this.text,this .Font,b,积极的飞机,sf );

b.Dispose (;

}

} 2.页面designer.cs已更改为MyTextBox

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。