代码拉取完成,页面将自动刷新
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace FloatingWindow
{
public partial class BGLabel : Label
{
public bool BackColorVisible=true;
public bool BorderColorVisible=true;
public int Taget=70;
public int Value=00;
public BGLabel()
{
}
protected override void OnPaintBackground (PaintEventArgs e){
base.OnPaintBackground(e);
if(BackColorVisible){
if(Value>=Taget){
Brush brush=new SolidBrush(Color.Red);
int height=Height*Value/100;
e.Graphics.FillRectangle(brush,0,Height-height,Width,Height);
}else{
Brush brush=new SolidBrush(Color.Green);
int height=Height*Value/100;
e.Graphics.FillRectangle(brush,0,Height-height,Width,Height);
}
}
if(BorderColorVisible&&Value>=Taget){
Pen pen = new Pen(Color.Red,1);
e.Graphics.DrawRectangle(pen,0,0,Width-1,Height-1);
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。