- [VB.NET] Lấy địa chỉ Bios Serial Number trên Winform
- [C#] Giới thiệu và sử dụng thư viện AutoMapper
- [DEVEXPRESS] Hướng dẫn Custom Summary in Footer trong Gridview C#
- [C#] Dependency Injection in Winform
- [SQLSERVER] Hướng dẫn tìm kiếm nâng cao trên sql
- [C#] Hướng dẫn sử dụng SetTimeOut trên Winform like Javascript
- [DATABASE] In cây thông noel bằng sqlserver
- [C#] Hướng dẫn fix lỗi hiển thị UTF-8 khi sử dụng WebClient Download String
- [DATABASE] Hướng dẫn mã hóa và giải mã sử dụng thuật toán AES 256 trên sqlserver
- [DATABASE] Base64 Encode and Decode trong Sqlserver
- [C#] Vì Mẹ anh bắt phải Fake địa chỉ MacAddress
- [C#] Hướng dẫn xuất dữ liệu từ DataGridview ra file Excel
- [C#] Hướng dẫn khởi động lại chương trình ứng dụng winform
- [C#] Sự khác nhau giữa String.IsNullOrEmpty và String.IsNullOrWhiteSpace
- [C#] Hướng dẫn đọc file hình ảnh định dạng WEBP và chuyển đổi WebP sang JPG
- [C#] Kiểm tra phiên bản Microsoft Office đang sử dụng trên máy tính
- [C#] Hướng dẫn chuyển đổi tập tin hình ảnh XPS sang Bitmap
- [C#] Giới thiệu Component WebView2 của Microsoft
- [C#] Hướng dẫn lưu tất cả hình ảnh từ File Excel vào thư mục window
- [DATABASE] Hướng dẫn import và export hình ảnh image từ Sqlserver
[DEVEPXRESS] Hướng dẫn sử dụng Do not show message Again trong XtraMessageBox Winform
Xin chào quý vị, bài viết hôm nay mình sẽ chia sẻ đến quý vị chức năng DoNotShowAgainCheck trên XtraMessageBox của Devexpress, Winform.
[DEVEXPRESS] Do Not Show Again Check in XtraMessageBox C#
Chức năng này được tích hợp từ phiên bản Devexpress phiên bản 20.1
nhé quý vị.
Giao diện demo ứng dụng:
Khi các bạn muốn cho phép người dùng, không hiển thị thông báo này vào lần sau.
Thì các bạn có thể thêm tùy chỉnh này như hình bên dưới.
Source code Xtra Messagebox Devexpress C#:
using DevExpress.XtraEditors;
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 DoNotShowAgainCheck
{
public partial class Form1 : DevExpress.XtraEditors.XtraForm
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void Xma_Load(object sender, XtraMessageBoxLoadArgs e)
{
if (e.Visible == true)
{
e.ShowMessage();
}
}
private void simpleButton1_Click(object sender, EventArgs e)
{
XtraMessageBoxArgs xma = new XtraMessageBoxArgs();
xma.Caption = "Thông báo - laptrinhvb.net";
xma.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True;
xma.Text = "Các em chia sẽ cho Thầy đi \"(<color=red><b>Lộc Fuho</b></color>)\"";
xma.DoNotShowAgainCheckBoxVisible = true;
xma.DoNotShowAgainCheckBoxText = "Tôi không muốn hiển thị thông báo này nữa, :(";
xma.Buttons = new[] { DialogResult.Yes, DialogResult.No};
xma.Icon = SystemIcons.Information;
xma.Load += Xma_Load;
xma.Closed += Xma_Closed;
XtraMessageBox.Show(xma);
}
private void Xma_Closed(object sender, XtraMessageBoxClosedArgs e)
{
bool messageDisplayed = e.Visible;
XtraMessageBox.Show(messageDisplayed.ToString());
}
}
}
Kết quả checkbox trả về true or false các bạn viết control ở hàm sự kiện event Closed
nhé.
Thanks for watching!