using DevExpress.XtraEditors; 对话框的使用 对话框#region 对话框 /// <summary> /// 确认对话框 /// </summary> /// <param name="strString">提示内容</param> /// <returns>用户点击结果</returns> public DialogResult Confirm(string strString) { return DevExpress.XtraEditors.XtraMessageBox.Show(strString,"提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Question); } /// <summary> /// 确认对话框 /// </summary> /// <param name="strSting">提示内容</param> public void ShowMessage(string strSting) { DevExpress.XtraEditors.XtraMessageBox.Show(strSting,"提示",MessageBoxButtons.OK,MessageBoxIcon.Information); } /// <summary> /// 确认删除对话框 /// </summary> /// /// <returns>用户点击结果</returns> public DialogResult ConfirmDelete() { return DevExpress.XtraEditors.XtraMessageBox.Show("确定要删除吗?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Question); } #endregion 使用用例: if(this.Confirm("确定要删除吗?") == DialogResult.Cancel) return;
时间: 2024-11-01 04:10:16