123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ
- {
- public class ItemValue
- {
- private string _text = string.Empty;
- public string Text
- {
- get
- {
- if (this._text != null)
- {
- return this._text;
- }
- return string.Empty;
- }
- set { _text = value; }
- }
- private object _value = string.Empty;
- public object Value
- {
- get { return this._value; }
- set { this._value = value; }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="_value"></param>
- /// <param name="_text"></param>
- public ItemValue(object value, string text)
- {
- this._value = value;
- this._text = text;
- }
- object _tag;
- /// <summary>
- ///
- /// </summary>
- public object Tag
- {
- get { return _tag; }
- set { _tag = value; }
- }
- public override string ToString()
- {
- return this._text;
- }
- }
- /// <summary>
- /// 自定义弹窗,显示可包含文本、按钮和符号(通知并指示用户)的消息框。
- /// </summary>
- public class MessageBoxCustom
- { /// <summary>
- /// 弹出消息框
- /// </summary>
- /// <param name="msg">要显示的消息</param>
- /// <param name="title">标题 可以省略</param>
- /// <returns></returns>
- public static DialogResult Show(string msg, string title = "提示消息!", MessageBoxButtons msgBoxButton = MessageBoxButtons.OK, System.ComponentModel.BackgroundWorker backgroundWorker=null,bool isTop=false)
- {
- try
- {
- if (backgroundWorker != null)
- {
- backgroundWorker.ReportProgress(-1);
- }
- }
- catch {
- backgroundWorker.Dispose();
- backgroundWorker = null;
- }
- LYFZ.ComponentLibrary.frmMessageBox msgBox = new LYFZ.ComponentLibrary.frmMessageBox();
- msgBox.IsLoginValidation = false;
- msgBox.Text = title;
- msgBox.lbMseValue.Text = msg;
- msgBox.TopMost = isTop;
- msgBox.MsgBoxButtons = msgBoxButton;
- DialogResult dialogResult=msgBox.ShowDialog();
- try
- {
- if (backgroundWorker != null)
- {
- backgroundWorker.ReportProgress(0);
- }
- }
- catch { }
- return dialogResult; //msgBox.DialogResult;
- }
- }
- }
|