59 lines
1.5 KiB
C#
59 lines
1.5 KiB
C#
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 VSoft.Skins
|
|
{
|
|
public partial class FrmMessageBox : Skins.SKinForm
|
|
{
|
|
public FrmMessageBox()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
public MessageBoxButtons ResultDg { get; set; } = MessageBoxButtons.OKCancel;
|
|
private void btnYes_Click(object sender, EventArgs e)
|
|
{
|
|
if (this.Modal)
|
|
{
|
|
switch (ResultDg)
|
|
{
|
|
case MessageBoxButtons.YesNo:
|
|
this.DialogResult = DialogResult.Yes;
|
|
break;
|
|
default:
|
|
this.DialogResult = DialogResult.OK;
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Close();
|
|
}
|
|
}
|
|
|
|
private void btnCancel_Click(object sender, EventArgs e)
|
|
{
|
|
switch (ResultDg)
|
|
{
|
|
case MessageBoxButtons.YesNo:
|
|
this.DialogResult = DialogResult.No;
|
|
break;
|
|
default:
|
|
this.DialogResult = DialogResult.Cancel;
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void LblMsg_TextChanged(object sender, EventArgs e)
|
|
{
|
|
lblMsg.UpdateInfo();
|
|
lblMsg.Refresh();
|
|
}
|
|
}
|
|
}
|