You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

44 lines
969 B

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 WinFormControl
{
public partial class UMessageBox : Form
{
public UMessageBox()
{
InitializeComponent();
}
static UMessageBox messageBox;
public static void Show(string message)
{
if (messageBox == null)
messageBox = new UMessageBox();
if (message.Length >= 50)
message = message.Substring(0, 50) + "……";
messageBox.label1.Text = message;
messageBox.ShowDialog();
}
public static void Show(string message, string title)
{
if (messageBox == null)
messageBox = new UMessageBox();
messageBox.Text = title;
Show(message);
}
private void uButton1_Click(object sender, EventArgs e)
{
this.Close();
}
}
}