- [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
[C#] Chia sẽ class BackGroundOverlay Show Modal cho Winform
Xin chào các bạn, bài viết hôm nay mình sẽ chia sẽ đến các bạn Class BackgroundOverlay, mình viết Extension method dùng để show Modal cho Form C#.
[C#] Overlay Show Modal Winform
Dưới đây là giao diện demo ứng dụng Show Modal C#:

Đầu tiên các bạn tạo cho mình 1 class BackgroundOverlay C#:
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BlurBackgroundDemo
{
    public static class BackGroundOverlay
    {
        public static void ShowModal(this Form form, Form parentForm, Color? colorOverlay = null)
        {
            Form formBackground = new Form();
            try
            {
                formBackground.StartPosition = FormStartPosition.Manual;
                formBackground.FormBorderStyle = FormBorderStyle.None;
                formBackground.Opacity = .50d;
                formBackground.BackColor = colorOverlay ?? Color.Black;
                formBackground.WindowState = FormWindowState.Maximized;
                formBackground.TopMost = true;
                formBackground.Location = parentForm.Location;
                formBackground.ShowInTaskbar = false;
                formBackground.Show();
                form.Owner = formBackground;
                form.ShowDialog();
                formBackground.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                formBackground.Dispose();
            }
        }
    }
}
Và cách sử dụng khi show form C#:
private void button1_Click(object sender, EventArgs e)
{
    var uu = new SubForm ();
    uu.ShowModal(this, Color.Orange);
}Cách bạn có thể truyền màu vào theo mình yêu thích.
Nếu không truyền thì mặc định màu đen nhé.
Thanks for watching!

![[C#] Chia sẽ class BackGroundOverlay Show Modal cho Winform](https://laptrinhvb.net/uploads/users/9a8cb514e4428e85fb4ca07588e9103f.png)

![[C#] Hướng dẫn thêm, lưu, xóa, sửa với Redis Database](https://laptrinhvb.net/uploads/source/csharp/redis_database_thumb.png)
![[C#] Hướng dẫn xuất danh sách hình ảnh nhân viên ra file Excel](https://laptrinhvb.net/uploads/source/web/image_excel_thumb.png)
![[C#] Maximize, Minimize, Restore và Hide cửa sổ trên Windows Console](https://laptrinhvb.net/uploads/source/new_image_baiviet/web_client_download_string.png)
![[C#] Hướng dẫn lưu danh sách hình ảnh dạng file nhị phân](https://laptrinhvb.net/uploads/source/vbnet/image_thumb.png)
![[C#] Sử dụng Attribute Annotation trong lập trình C# CSharp](https://laptrinhvb.net/uploads/source/devexpress/su-dung-attribute-annotation-trong-lap-trinh-c-csharp-1594.jpg)
![[C#] Hướng dẫn sử dụng thư  viện Microsoft WindowsAPICodePack](https://laptrinhvb.net/uploads/source/image_baiviet/5d7b706fe239b97ac0157cd0bedfd9a6.jpg)
![[C#] Hướng dẫn đọc thuộc tính file trong lập trình csharp](https://laptrinhvb.net/uploads/source/image_baiviet/25aaaba21c918e94b1b16a0e11d2b25d.png)
![[C#] Giới thiệu  thư viện Xander UI Framework dùng thiết kế Winform](https://laptrinhvb.net/uploads/source/csharp/XanderUIFramework_thumb.png)
![[C#] Tạo SecureString TextBox trong winform](https://laptrinhvb.net/uploads/source/csharp/secure_string_thumb.png)
![[C#] Hướng dẫn scan multi QRCode, Barcode Realtime sử dụng Zxing.Net và AForge](https://laptrinhvb.net/uploads/source/csharp/scan_qrcode_csharp_thumb.png)
![[C#] Hướng dẫn in hóa đơn Invoice từ Template HTML và xuất ra file PDF](https://laptrinhvb.net/uploads/source/new_image_baiviet/screenshot_1663319839.png)
![[C#] Hướng dẫn gởi dữ liệu Text từ ứng dụng sang chương trình Notepad](https://laptrinhvb.net/uploads/source/image_baiviet/2946ab524b63e5cdd634f19233d03ec2.png)
![[C#] Bắt sự kiện Windows Shutdown hoặc Logoff, xuất cảnh báo cho người dùng muốn lưu dữ liệu lại không](https://laptrinhvb.net/uploads/source/new_image_baiviet/show_message_windows_shutdown%20(1).png)
![[C#] Hiệu ứng Typewriter effect trên console](https://laptrinhvb.net/uploads/source/vbnet/text_typing_console.gif)

![[C#] Hướng dẫn nhúng font chữ mới vào Winform](https://laptrinhvb.net/uploads/source/csharp/private_font_csharp_thumb.jpg)
![[C#] Hướng dẫn xem lịch sử các trang web đã truy cập trên Chrome Browser](https://laptrinhvb.net/uploads/source/vbnet/HistoryChrome_thumb.jpg)
![[C#] Giới thiệu và sử dụng thư viện DynamicExpresso dùng để tính toán trên chuỗi](https://laptrinhvb.net/uploads/source/vbnet/dynamic_expresso.jpg)

![[C#] Hướng dẫn publish Website vào Internet Services Information (IIS)](https://laptrinhvb.net/uploads/source/new_image_baiviet/iss_services.jpg)
![[C#] Hướng dẫn thêm xóa sửa trong database MongoDB](https://laptrinhvb.net/uploads/source/csharp/mongodb_thumb.png)
![[C#] Hướng dẫn viết ứng dụng Scan QR code, barcode trực tiếp qua Webcam](https://laptrinhvb.net/uploads/source/csharp/scan_qrcode_realtime_thumb.png)
![[C#] Hướng dẫn chỉnh sửa Text của label trực tiếp trên winform](https://laptrinhvb.net/uploads/source/new_image_baiviet/edit_label-runtime.gif)
![[C#] Tạo hiệu ứng Window Matrix Effect](https://laptrinhvb.net/uploads/source/vbnet/window_matrix_effect.png)
![[C#] Sử dụng Google Translate API để dịch văn bản](https://laptrinhvb.net/uploads/source/vbnet/Google%20Translator%20C%23.jpg)
