Custom Message Box Cho C# & VB.NET

Hôm nay chia sẻ tới các bạn cách tạo message box thay thế cho message nguyên thủy của .NET.
Trong 1 số trường hợp message box nguyên thủy không thực hiện đúng như bạn mong muốn.
Đơn cử như trường hợp bạn muốn show ra 1 list các value bị lỗi trong List nhưng lại quá dài khiến cho message bị như sau:

Hướng giải quyết ra sao.Mời các bạn xem hình sau:

Dưới đây là source code để sử dụng cho C#:
FlexibleMessageBox.Show("Just a text");
FlexibleMessageBox.Show("A text", "A caption");

FlexibleMessageBox.Show("Some text with a link: www.google.com", 
                        "Some caption",
                        MessageBoxButtons.AbortRetryIgnore, 
                        MessageBoxIcon.Information,
                        MessageBoxDefaultButton.Button2);

var result = FlexibleMessageBox.Show("Know the answer to life the universe and everything?", 
            "One short question", 
            MessageBoxButtons.YesNo); //By the way: The answer is 42  :-)
Dưới đây là source code để sử dụng cho VB.NET:
FlexibleMessageBox.Show("Just a text")
FlexibleMessageBox.Show("A text", "A caption")

FlexibleMessageBox.Show("Some text with a link: www.google.com", 
                        "Some caption",
                        MessageBoxButtons.AbortRetryIgnore, 
                        MessageBoxIcon.Information,
                        MessageBoxDefaultButton.Button2)

var result = FlexibleMessageBox.Show("Know the answer to life the universe and everything?", 
            "One short question", 
            MessageBoxButtons.YesNo) //By the way: The answer is 42  :-)
Link download cho C#: https://drive.google.com/file/d/0BwMaaJ3ORdLoRFJzelpOMHBlOVU/view
Link download cho VB.NET: https://drive.google.com/file/d/0BwMaaJ3ORdLoQnlkM1RJTktYb0k/view?usp=sharing
Chúc các bạn thành công ! Nguồn : http://www.codeproject.com/Articles/601900/FlexibleMessageBox
Previous
Next Post »