- [C#] Lấy thông tin cấu hình máy tính xuất ra text file winform
- [C#] Chia sẽ class Install, Uninstall, Start và Stop Services Winform
- [C#] Tìm kiếm tập tin file nhanh chóng trên Winform sử dụng thư viện FastSearchLibrary
- [C#] Giới thiệu thư viện Fluent FTP Awesome dùng để làm việc với FTP
- [C#] Sử dụng thư viện Mini Profiler Integrations ghi log thực hiện các câu lệnh SQL
- [DEVEXPRESS] Thiết kế Dropdown ButtonBarItem trên Form Ribbon
- [C#] Lưu trạng thái các control trên Winform vào Registry Windows
- [C#] Ứng dụng ví dụ Simple Observer Pattern tăng giảm số lượng trên winform
- [C#] Hướng dẫn lấy thời gian thực server time trên winform
- [DEVEXPRESS] Hướng dẫn bật tính năng Scroll Pixcel in Touch trên GridView
- [DEVEXPRESS] Hướng dẫn sử dụng TileBar viết ứng dụng duyệt hình ảnh Winform
- [DEVEXPRESS] Tô màu border TextEdit trên Winform
- [C#] Lấy dữ liệu từ Console Write hiển thị lên textbox Winform
- [C#] Hiển thị Progress bar trên Window Console
- [C#] Di chuyển control Runtime và lưu layout trên winform
- [SQLSERVER] Sử dụng hàm NULL IF
- [C#] Chia sẽ source code mã đi tuần bằng giao diện Winform
- [C#] Flash Window in Taskbar Winform
- Download và Giải nén tập tin File sử dụng Powershell
- [C#] Hướng dẫn cách lấy thông tin đăng nhập tài khoản và mật khẩu web browser trên windows
[DEVEXPRESS] Hướng dẫn thay đổi giao diện sử dụng Look and Feel C#
Bài viết hôm nay, mình xin hướng dẫn các bạn sử dụng Look and Feel để thay đổi giao diện trong bộ công cụ Devexpress. Mặc định, Devexpress đã cung cấp cho chúng ta gồm rất nhiều kiểu giao diện: Office, Mac, Valentine, Blue, Dark...
Hướng dẫn thay đổi giao diện theme Devexpress C#
Để thay đổi giao diện ứng dụng Winform, chúng ta sẽ load tất cả các giao diện trong thư viện Devexpress vào công cụ ImageCombobox của Devexpress.
Sau khi chúng ta chọn thì ứng dụng sẽ thay đổi giao diện, đồng thời chúng ta cũng lưu thêm biến theme xuống hệ thống.
Để lần sau, khởi động ứng dụng lên, ứng dụng mặc định sẽ load giao diện mà chúng ta đã chọn.
Giao diện demo ứng dụng thay đổi giao diện C#:
Đầu tiên, các bạn viết sử kiện cho hàm load tất cả giao diện vào combobox:
ImageCollection img;
public Form1()
{
InitializeComponent();
img = new ImageCollection();
imageComboBoxEdit1.Properties.SmallImages = img;
for (int i = 0; i < SkinManager.Default.Skins.Count; i++)
{
string skinName = SkinManager.Default.Skins[i].SkinName;
img.AddImage(SkinCollectionHelper.GetSkinIcon(skinName, SkinIconsSize.Small), skinName);
imageComboBoxEdit1.Properties.Items.Add(new ImageComboBoxItem(skinName, i));
if (skinName == Properties.Settings.Default.theme)
{
imageComboBoxEdit1.SelectedIndex = i;
}
}
defaultLookAndFeel1.LookAndFeel.SetSkinStyle(Properties.Settings.Default.theme);
}
- Tiếp tục chúng ta sẽ viết tiếp hàm cho sự kiện thay đổi giá trị Image combobox thì giao diện thay đổi:
private void imageComboBoxEdit1_SelectedValueChanged(object sender, EventArgs e)
{
DevExpress.XtraEditors.ComboBoxEdit edit = sender as DevExpress.XtraEditors.ComboBoxEdit;
defaultLookAndFeel1.LookAndFeel.SetSkinStyle(edit.EditValue.ToString());
Properties.Settings.Default.theme = edit.EditValue.ToString();
// Lưu lại
Properties.Settings.Default.Save();
}
HAVE FUN :)