Files
KJD_WebService/TEMUKJD/ChatForms/ChatMessageForm.cs
T
2025-07-09 10:09:32 +08:00

89 lines
2.6 KiB
C#

using AllBase.Model.Result;
using TemuKJD.KJDForms.BaseForms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TemuKJD.ChatForms
{
public partial class ChatMessageForm : LRBaseForm
{
public ShopLoginInfo shop;
public ChatForm cf;
public ChatMessageForm(ShopLoginInfo _shop, ChatForm _cf)
{
InitializeComponent();
this.shop = _shop;
this.cf = _cf;
this.Load += ChatMessageForm_Load;
this.FormClosed += ChatMessageForm_FormClosed;
this.TopMost = true;
}
private void ChatMessageForm_FormClosed(object sender, FormClosedEventArgs e)
{
ChatForm.lstChatMessageForm.Remove(this);
}
private void ChatMessageForm_Load(object sender, EventArgs e)
{
if (shop != null)
{
this.pnlMessage.Text = "店铺" + shop.ShopAccount + "有新消息\r\n点击查看";
}
var height = this.Height;
Task.Run(() =>
{
for (int i = 0; i < height; i++)
{
Invoke(new Action(() =>
{
Point p = new Point(Screen.PrimaryScreen.WorkingArea.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Height);
this.Location = new Point(p.X, p.Y - i);
}));
Thread.Sleep(5);
}
//Thread.Sleep(2000);
//var _opacity = 1.0;
//while (_opacity > 0)
//{
// _opacity -= 0.02;
// Invoke(new Action(() =>
// {
// this.Opacity = _opacity;
// if (this.Opacity <= 0)
// this.Close();
// }));
// Thread.Sleep(100);
//}
});
}
private void pnlMessage_Click(object sender, EventArgs e)
{
if (cf != null)
{
cf.TopMost = true;
cf.DgvShopClick(shop);
Task.Run(() =>
{
Thread.Sleep(1000);
Invoke(new Action(() =>
{
this.TopMost = false;
cf.TopMost = false;
}));
});
}
}
}
}