私は透明なカスタム ラベル クラスを実行しようとしていますが、これについて多くの記事を検索していましたが、透明なラベルを使用してカウントダウンを実行しようとしている場合、私のケースは異なります。次に、以下のサンプル コードを使用すると成功します。ちらつき。間隔を 100 に設定してタイマーを使用し、テキストのカスタム ラベルを変更します。更新時にパフォーマンスを向上させるために何ができるかわかりません。
class CustomLabel : Label
{
public CustomLabel()
{
this.SetStyle(ControlStyles.Opaque, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
}
protected override System.Windows.Forms.CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x20;
return cp;
}
}
public override string Text
{
get
{
return base.Text;
}
set
{
base.Text = value;
RecreateHandle();
}
}
}