tijian_tieying/web/dccdc.Selfhelp/Status.cs

54 lines
1.4 KiB
C#
Raw Permalink Normal View History

2025-02-20 12:14:39 +08:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace dccdc.Selfhelp
{
public partial class Status : Form
{
private string _message;
public Status()
{
InitializeComponent();
}
public Status(string msg,bool t=true):this()
{
timer1.Enabled = t;
_message = msg;
}
public void update(string msg)
{
//this.Show();
_message = msg;
this.Invalidate();
}
private void Status_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
//Image img = Image.FromFile(Application.StartupPath + "\\fzbjt.jpg");
//Rectangle rect = new Rectangle(0, 0, 800, 600);
//g.DrawImage(img, rect);
Font f = new Font("微软雅黑", 32, FontStyle.Bold);
SizeF s = g.MeasureString(_message, f);
PointF p = new PointF((int)(this.Width - s.Width) / 2 , (this.Height-s.Height)/2);
g.DrawString(_message, f, Brushes.White, p);
}
private void timer1_Tick(object sender, EventArgs e)
{
this.Hide();
}
private void Status_Load(object sender, EventArgs e)
{
this.TopLevel = true;
}
}
}