- [DEVEXPRESS] Chia sẻ source code cách tạo biểu đồ sơ đồ tổ chức công ty Org Chart trên Winform C#
- [C#] Hướng dẫn tạo Auto Number trên Datagridview winform
- [DATABASE] Hướng dẫn tạo Procedure String Split in Mysql
- [C#] Thiết lập dấu (,) hay dấu (.) ở định dạng số đúng với định dạng số Việt Nam
- [C#] Chia sẻ source code Game Spin Lucky Wheel
- [C#] Hướng dẫn Encode and Decode HTML
- Danh sách tài khoản ChatGPT miễn phí - Hướng dẫn tạo tài khoản Chat Open AI GPT tại Việt Nam
- [C#] Hướng dẫn thay đổi giao diện ứng dụng Winform theo giao diện của Windows
- [VB.NET] Hiệu ứng Acrylic, Mica, Tabbed Blur Effect trên Winform
- [DEVEXPRESS] Hướng dẫn sử dụng HTML Template trên Combobox Edit
- [C#] Chia sẻ source code Orange Rain in Winform
- [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 and CSS Code Viewer trên Winform
- [C#] Number Effect Counter up and down in winform
- [C#] Hướng dẫn Supend and Resume Process ID in Winform
- [C#] Hiển thị line number trên Richtextbox Winform
- [C#] Fake Blue Screen BSOD in winform
- [C#] Chia sẽ code demo sử dụng Async Parallel Foreach and For in Winform
- [C#] Sử dụng ActionBlock run X task at time winform
- [C#] Hướng dẫn sử dụng Property Grid để lưu và tải lại thông tin cấu hình user trên winform
[DEVEXPRESS] Hướng dẫn sử dụng HTML and CSS Code Viewer trên Winform
Xin chào các bạn, bài viết hôm nay mình tiếp tục chia sẻ các bạn cách sử dụng HTMLCodeViewer và CSSCodeViewer trên Devexpress Winform.
[DEVEXPRESS] How to using HTML and CSS code viewer
Hai control này trên Devexpress mặc định không có hiển thị ở thanh ToolBox của Visual Studio.
Nên các bạn cần viết một vào dòng code để hiện thị nó lên và gắn vào Panel control.
Giao diện demo ứng dụng:
Các bạn có thể xem video hướng dẫn từng bước thực hiện:
Source code c#:
using DevExpress.XtraEditors.Internal;
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 HTMLCSSCodeEditor
{
public partial class Form1 : DevExpress.XtraEditors.XtraForm
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
var htmlCodeEditor = new HtmlCodeViewer();
htmlCodeEditor.ReadOnly = false;
htmlCodeEditor.Dock = DockStyle.Fill;
htmlCodeEditor.AllowCodeFolding = DevExpress.Utils.DefaultBoolean.True;
htmlCodeEditor.ShowIndentGuides = DevExpress.Utils.DefaultBoolean.True;
htmlCodeEditor.ShowLineNumbers = DevExpress.Utils.DefaultBoolean.True;
htmlCodeEditor.ScrollBars = ScrollBars.Both;
// add control to panel
panelHTMLEditor.Controls.Add(htmlCodeEditor);
var cssCodeEditor = new CssCodeViewer();
cssCodeEditor.ReadOnly = false;
cssCodeEditor.Dock = DockStyle.Fill;
cssCodeEditor.AllowCodeFolding = DevExpress.Utils.DefaultBoolean.True;
cssCodeEditor.ShowIndentGuides = DevExpress.Utils.DefaultBoolean.True;
cssCodeEditor.ShowLineNumbers = DevExpress.Utils.DefaultBoolean.True;
cssCodeEditor.ScrollBars = ScrollBars.Both;
// press Ctrol + Alt + . => multi select in visual studio
// add control to panel
panelCSSEditor.Controls.Add(cssCodeEditor);
}
}
}
Thanks for watching!