前两个月由于项目需要,要求做一个半透明窗体,翻阅了很多网站都不尽人意,在吸取了众家之长后,终于得到了比较满意的答案,效果图如下
直接上代码
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;
namespace TransparentWindow
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load( object sender, EventArgs e )
{
SetBackgroundImageTransparent();
}
private Color tr_color = Color.Transparent;
private bool b_start = false;
bool[] b_visible = null;
priva