NEWS

[DEVEXPRESS] Hướng dẫn sử dụng HTML Template trên XtraMessageBox Winform Devexpress 22.2.3

[DEVEXPRESS] Hướng dẫn sử dụng HTML Template trên XtraMessageBox Winform Devexpress 22.2.3
Đăng bởi: Thảo Meo - Lượt xem: 4665 13:11:58, 20/12/2022DEVEXPRESS   In bài viết

Xin chào các bạn, bài viết hôm nay mình tiếp tục hướng dẫn các bạn sử dụng HTML Template trên XtraMessagebox Devexpress Winform C#.

[DEVEXPRESS] How to using HTML Template XtraMessageBox Winform 

Trong bài này mình đang sử dụng phiên bản Devexpress 22.2.3 nhé.

Giao diện demo ứng dụng:

Template 1:

template_1

Template 2:

template_1

Template 3:

template_2

Chi tiết các bước thực hiện, các bạn tham khảo ở Video nhé:

Source code C#:

using DevExpress.Utils.Html;
using DevExpress.Utils.Svg;
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 HTMLXtraMessageBox
{
   
    public partial class Form1 : DevExpress.XtraEditors.XtraForm
    {      
        public Form1()
        {
            InitializeComponent();
        }

        private void btnConfirm_Click(object sender, EventArgs e)
        {
            XtraMessageBoxArgs args = new XtraMessageBoxArgs();
            args.HtmlTemplate.Assign(MyConfirmTemplate);
            args.Caption = "Application";
            args.Text = "Do you want to save changes to the file?";
            args.DefaultButtonIndex = 0;
            var result = XtraMessageBox.Show(args);
            var results = result;

        }

        private void btnDeleteMessage_Click(object sender, EventArgs e)
        {
            XtraMessageBoxArgs args = new XtraMessageBoxArgs();           
            args.HtmlTemplate.Assign(MyDeleteMessage);
            args.HtmlImages = svgImageCollection1;
            args.Caption = "Delete file permanently?";
            args.Text = "If you delete this file you won't be able to recover it. Do you want to delete it?";           
            args.DefaultButtonIndex = 0;
            var result = XtraMessageBox.Show(args);
        }

        private void btnInformationMessage_Click(object sender, EventArgs e)
        {
            XtraMessageBoxArgs args = new XtraMessageBoxArgs();
            args.HtmlImages = svgImageCollection1;
            args.HtmlTemplate.Assign(NotificationMessage);
            args.Caption = "Successful";
            args.Text = "Your changes have been successfully saved.";
            args.ImageOptions.SvgImage = svgImageCollection1[0];            
            args.DefaultButtonIndex = 0;
            var result = XtraMessageBox.Show(args);
        }
    }
}

Thanks for watching!

DOWNLOAD SOURCE

THÔNG TIN TÁC GIẢ

BÀI VIẾT LIÊN QUAN

[DEVEXPRESS] Hướng dẫn sử dụng HTML Template trên XtraMessageBox Winform Devexpress 22.2.3
Đăng bởi: Thảo Meo - Lượt xem: 4665 13:11:58, 20/12/2022DEVEXPRESS   In bài viết

CÁC BÀI CÙNG CHỦ ĐỀ

Đọc tiếp
.