[英]Making a transparent button
我正在使用Winforms應用程序,並為Microsoft .NET Framework導入了Windows API代碼包。 下面是我的代碼:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsAPICodePack.Taskbar;
using Microsoft.WindowsAPICodePack.Shell;
namespace Glass_Test2
{
...
}
但是當我嘗試在其上添加按鈕時,結果卻像這樣:
誰能告訴我如何使此處的按鈕透明?
如果您不能切換到WPF,我將使用GDI +並繪制矩形-可以響應鼠標事件。 現在,您可以控制透明度。
Public Class GDIButton
Public Property Bounds As Rectangle
Public Property Text As String
Public Property BorderColor As Color
Public Property FillColor As Color
End Class
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.