Language/C#(CLR,.NET)
[C#]Window Form에 적용할 DevExpress Skin 관련 소스
천일몽
2013. 4. 3. 09:24
참조 : http://documentation.devexpress.com/#WindowsForms/clsDevExpressSkinsSkinManagertopic
using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace UserPark { static class Program { /// <summary> /// 해당 응용 프로그램의 주 진입점입니다. /// </summary> [STAThread] static void Main() { //DevExpress 보너스 스킨 등록(활성화) DevExpress.UserSkins.BonusSkins.Register(); //DevExpress.XtraEditors.XtraForm(SDI Form) 스킨기능 활성화 DevExpress.Skins.SkinManager.EnableFormSkins(); //DevExpress.XtraEditors.XtraForm(MDI Form) 스킨기능 활성화 DevExpress.Skins.SkinManager.EnableMdiFormSkins(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new TfrmMain()); } } }
Program.cs 파일에 Line 16~21 코드를 추가한다.
※ 반드시는 아니나…. 추천….
자세한 설명은 생략
- Main 폼에 아래 소스 추가하면 스킨갤러리를 사용할 수 있다.
- “DevExpress.XtraBars.RibbonGalleryBarItem” or “DevExpress.XtraBars.Ribbon.GalleryControl” 타입으로 “GalleryItemSkins”명으로 생성(추가) 하였을 경우 아래 코드를 소스에 추가하여 준다.
DevExpress.XtraBars.Helpers.SkinHelper.InitSkinGallery(GalleryItemSkins, true);
스킨 종류 선언
Program.cs에 아래 소수 추가(“DevExpress Dark Style” 사용시) ※반드시는 아니나…. 추천….
DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("DevExpress Dark Style");// or
DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "DevExpress Dark Style";DevExpress.LookAndFeel.UserLookAndFeel.Default.UseWindowsXPTheme = false;