0

I am working on a Winforms application and imported the Windows API Code Pack for the Microsoft .NET Framework. Below is my code:

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
{
...
}

But when I tried to add a button on it, it turned out like:

enter image description here

Can any body tell me how to make the button here transparent?

4

1 回答 1

0

如果您不能切换到 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
于 2013-02-23T02:29:37.797 回答