- [DEVEXPRESS] Hỗ trợ tìm kiếm highlight không dấu và không khoảng cách trên Gridview Filter
- [C#] Chia sẻ source code phần mềm Image Downloader tải hàng loạt hình ảnh từ danh sách link url
- [C#] Chụp hình và quay video từ camera trên winform
- [C#] Chia sẽ full source code tách file Pdf thành nhiều file với các tùy chọn
- Giới thiệu về Stock Tracker Widget - Công cụ theo dõi cổ phiếu và cảnh báo giá tăng giảm bằng C# và WPF
- [VB.NET] Chia sẻ công cụ nhập số tiền tự động định dạng tiền tệ Việt Nam
- [VB.NET] Hướng dẫn fill dữ liệu từ winform vào Microsoft word
- [VB.NET] Hướng dẫn chọn nhiều dòng trên Datagridview
- Hướng Dẫn Đăng Nhập Nhiều Tài Khoản Zalo Trên Máy Tính Cực Kỳ Đơn Giản
- [C#] Chia sẻ source code phần mềm đếm số trang tập tin file PDF
- [C#] Cách Sử Dụng DeviceId trong C# Để Tạo Khóa Cho Ứng Dụng
- [SQLSERVER] Loại bỏ Restricted User trên database MSSQL
- [C#] Hướng dẫn tạo mã QRcode Style trên winform
- [C#] Hướng dẫn sử dụng temp mail service api trên winform
- [C#] Hướng dẫn tạo mã thanh toán VietQR Pay không sử dụng API trên winform
- [C#] Hướng Dẫn Tạo Windows Service Đơn Giản Bằng Topshelf
- [C#] Chia sẻ source code đọc dữ liệu từ Google Sheet trên winform
- [C#] Chia sẻ source code tạo mã QR MOMO đa năng Winform
- [C#] Chia sẻ source code phần mềm lên lịch tự động chạy ứng dụng Scheduler Task Winform
- [C#] Hướng dẫn download file từ Minio Server Winform
[DEVEXPRESS] Hướng dẫn tạo hiệu ứng form overlay in csharp
Xin chào các bạn, bài viết hôm nay mình sẽ tiếp tục hướng dẫn các bạn cách tạo hiệu ứng overlay trên panel winform C# sử dụng Devexpress.
[DEVEXPRESS] OVERLAY PANEL C#
Trong bài viết hôm trước bên chuyên mục mình đã có viết bài hướng dẫn các bạn cách tạo hiệu ứng làm mờ (blur) trong lập trình C#.
Bài hôm nay, mình sẽ hướng dẫn các bạn sử dụng SplashScreenManager để tạo hiệu ứng overlay cho winform.
Các bạn có thể theo dõi demo ứng dụng bên dưới để biết bài viết này mình viết về các gì:

Thường chức năng này các bạn sẽ ứng dụng để khóa nguyên vùng panel.
Đầu tiên các bạn tạo cho mình một class: CustomOverlayWindowPainter.cs
using System.Drawing;
using DevExpress.Utils.Drawing;
using DevExpress.XtraSplashScreen;
namespace TestProject
{
    public class CustomOverlayWindowPainter : OverlayWindowPainterBase
    {  
      
        private static readonly Font _font;   
       
        static CustomOverlayWindowPainter()
        {
            _font = new Font("Tahoma", 16, FontStyle.Bold);
        }
     
       
        protected override void Draw(OverlayWindowCustomDrawContext context)
        {
            context.Handled = true;
            GraphicsCache cache = context.DrawArgs.Cache;
            cache.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
            
            Rectangle boundRectangle = context.DrawArgs.Bounds;
            context.DrawBackground();
            string message = "OVERLAY PANEL C# - HTTPS://LAPTRINHVB.NET";
            SizeF textSize = cache.Graphics.MeasureString(message, _font);
            PointF point = new PointF
            (
                (boundRectangle.Width  - textSize.Width ) / 2,
                (boundRectangle.Height - textSize.Height) / 2
            );
            cache.Graphics.DrawString(message, _font, Brushes.Orange, point);
        }
       
    }
}
Và source code C# cho MainForm.cs:
using System;
using DevExpress.XtraEditors;
using DevExpress.XtraSplashScreen;
namespace TestProject
{
    public partial class MainForm : XtraForm
    {
        public IOverlaySplashScreenHandle handle = null;
        public MainForm()
        {
            InitializeComponent();              
        }
        private void applyButton_Click(object sender, EventArgs e)
        {
        
            handle = SplashScreenManager.ShowOverlayForm(this.panel1, customPainter: new CustomOverlayWindowPainter());
        }
        private void cancelButton_Click(object sender, EventArgs e)
        {
            if (handle != null)
            {
                SplashScreenManager.CloseOverlayForm(handle);
            }
        }
    }
}
Thanks for watching!

![[DEVEXPRESS] Hướng dẫn tạo hiệu ứng form overlay in csharp](https://laptrinhvb.net/uploads/users/9a8cb514e4428e85fb4ca07588e9103f.png)

![[DEVEXPRESS] Khóa chọn ngày chủ nhật hoặc ngày đặc biệt trên DateEdit C#](https://laptrinhvb.net/uploads/source/devexpress/DisabledSpecialDayDateEdit_thumb.jpg)
![[DEVEXPRESS] Hướng dẫn tải hình ảnh bất đồng bộ (Load Image Async) vào GridView](https://laptrinhvb.net/uploads/source/image_baiviet/dfc3e7e817f2347d78121ef915833266.jpg)

![[DEVEXPRESS] Hướng dẫn sử dụng Mail Merge trong Rich Edit Control VB.NET](https://laptrinhvb.net/uploads/source/image_baiviet/70358a4543901f51420ea03a97e0cef3.png)
![[DEVEXPRESS] Hướng dẫn sử dụng Alert Control để hiện thị thông báo](https://laptrinhvb.net/uploads/source/devexpress/alertcontrol_thumb.jpg)

![[DEVEXPRESS] Hướng dẫn sử dụng Window UI Button Panel và Navigation Frame](https://laptrinhvb.net/uploads/source/devexpress/navigation_frame_thumb.png)
![[DEVEXPRESS] Chia sẻ source code tạo báo cáo report in tem nhãn label trên C# winform](https://laptrinhvb.net/uploads/source/devexpress/label_report_thumb.png)
![[DEVEXPRESS] Hướng dẫn nhúng Usercontrol vào hộp thoại XtraDialog](https://laptrinhvb.net/uploads/source/devexpress/xtra_dialog_devexpress.gif)
![[Devexpress] Biểu đồ Gantt là gì? Hướng dẫn lập trình vẽ biểu đồ Gantt dự án VB.NET](https://laptrinhvb.net/uploads/source/image_baiviet/a0cfca56b5469c04ad914e8f1fda4ff6.png)

![[DEVEXPRESS] Tích hợp Pause/Resume vào download Progress Cell Gridview](https://laptrinhvb.net/uploads/source/devexpress/pause_resume_donwload_csharp_thumb.jpg)
![[DEVEXPRESS] Hướng dẫn Move up và Move down giữa các dòng trong gridview](https://laptrinhvb.net/uploads/source/image_baiviet/8045cb06b01a6d465c24c92723612857.gif)
![[DEVEXPRESS] Fixed column Middle Left C# winform](https://laptrinhvb.net/uploads/source/devexpress/fixMiddleleft.gif)
![[DEVEXPRESS] Hướng dẫn sử dụng chọn nhiều dòng trên GridLookupEdit C#](https://laptrinhvb.net/uploads/source/devexpress/multiselect_gridlookupedit_csharp.png)
![[DEVEXPRESS] Hướng dẫn load Json DataSource vào GridView](https://laptrinhvb.net/uploads/source/new_image_baiviet/thumb_json_datasource_gridview_devexpress.png)
![[DEVEXPRESS] Hướng dẫn sử dụng Schedule Control hiển thị giờ làm việc nhân viên VB.NET](https://laptrinhvb.net/uploads/source/image_baiviet/339167705f9fa18eb1364ba9b83058af.png)
![[C#] DevExpress - Thay đổi màu ô trên lưới khi thay đổi giá trị](https://laptrinhvb.net/uploads/source/image_baiviet/ab88e604d32d5cb8dfc456ac0c00b9b8.png)


![[DEVEXPRESS] Hướng dẫn tích Filter Contain khi click chuột phải vào cell selection trên Gridview](https://laptrinhvb.net/uploads/source/vbnet/filter_gridview_devexpress_thumb.jpg)
![[DEVEXPRESS] Chia sẻ code các tạo report in nhiều hóa đơn trên XtraReport C#](https://laptrinhvb.net/uploads/source/devexpress/print_invoice_report.png)
![[DEVEXPRESS] Hướng dẫn thêm command Button Edit  và Delete trên Gridview C#](https://laptrinhvb.net/uploads/source/devexpress/inline_update_gridview_csharp.jpg)
![[DEVEXPRESS] Hướng dẫn sử dụng Flyout Dialog trên lập trình C#, winform](https://laptrinhvb.net/uploads/source/devexpress/flyoutdialog_thumb.jpg)
![[DEVEXPRESS] Hướng dẫn sử dụng TreeList C# để hiển thị danh sách theo dạng cây thư mục](https://laptrinhvb.net/uploads/source/image_baiviet/205478c9ad7994f6d1d1d90b06d28a7b.jpg)
