using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PopupWindow
{
public partial class Form1 : Form
{
System.Drawing.Bitmap b;
Bitmap T;
byte[] t;
byte[] s;
System.Threading.Thread show;
public Form1()
{
InitializeComponent();
Point p = new Point(500, 1024);
this.Location = p;
t = new byte[4];
t[0] = 5;
}
private void Form1_Load(object sender, EventArgs e)
{
show = new System.Threading.Thread(ShowForm);
show.IsBackground = true;
show.Start();
Rectangle E = Screen.PrimaryScreen.Bounds;
//减去像素的大小 可以根据form窗体来调整
Point p = new Point(Screen.PrimaryScreen.WorkingArea.Width - 396, Screen.PrimaryScreen.WorkingArea.Height - 231);
this.Location = p;
}
private void ShowForm()
{
double t = 0.1;
while (true)
{
if (this.InvokeRequired)
{
SetForm d = delegate (double value)
{
this.Opacity = value;
};
this.Invoke(d, new object[1] { t });
}
else
{
this.Opacity = t;
}
t += 0.1;
System.Threading.Thread.Sleep(150);
if (this.Opacity == 1.0)
{
break;
}
}
}
delegate void SetForm(double value);
}
}
winform右下角弹窗
最新推荐文章于 2024-07-10 09:09:21 发布