프로그래밍 45

Android Studio AVD GL error 0x502

플러터 데모 프로그램 실행 중 GL error 0x502 에러가 발생하면서 메인페이지가 안뜨는 현상이 발생하였다. 해결방법Android Studio > Tools > Device Manager > 구동디바이스 Edit > Graphics 옵션 기존 Automatic에서 Software로 변경개발환경Android Studio Jellyfish | 2023.3.1 Build #AI-233.14808.21.2331.11709847, built on April 13, 2024 Runtime version: 17.0.10+0--11572160 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 10.0 GC: G1 Young Generation, G1 ..

[C#] Winform/Devexpress GridView DoubleClick Event

Devexpress GridControl에서 Doubleclick을 처리하기 위한 방법 코드 // GridControl var gridView = (gridControl.MainView as GridView); gridView.DoubleClick += gridView_DoubleClick; /// /// GridView DoubleClick Event /// private void gridView_DoubleClick(object sender, EventArgs e) { DXMouseEventArgs ea = e as DXMouseEventArgs; GridView view = sender as GridView; GridHitInfo info = view.CalcHitInfo(ea.Location); ..

프로그래밍/C# 2023.06.29

[C#] Winform/WPF 디자인모드(DesignMode) 구분하기

Winform 개발 시 UserControl 같은곳에서 Load Event시 Database Call 혹은 실제로 런타임 중에만 실행되야 되는 코드가 있을 경우 DesignMode로 구분이 필요합니다. 샘플코드 bool isInWpfDesignerMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime); bool isInFormsDesignerMode = (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"); // Winform 에서 폼에서 직접 사용시 아래와 같은 프로퍼티를 추가한후 사용한다. private bool IsInFormsDesignerMode { get {..

프로그래밍/C# 2023.06.28

[C#] 경로 유효성 체크 - IsValidPath

경로 유효성 체크 IsValidPath 설치파일 등에서 경로 체크시에 사용된다. /// /// 경로가 유효한지 체크한다. /// /// 경로 private bool IsValidPath(string path) { // 경로 길이 체크 if (path.Length < 3) return false; // 드라이브 문자열 체크 Regex driveCheck = new Regex(@"^[a-zA-Z]:\\$"); if (driveCheck.IsMatch(path.Substring(0, 3)) == false) return false; // 경로 이름에 사용할 수 없는 문자가 있는지 체크 string invalidPathChars = new string(Path.GetInvalidPathChars()); inva..

프로그래밍/C# 2023.03.23

[C#] 레지스트리 등록, 조회, 삭제

32비트 레지스트리 등록, 조회, 삭제 // 경로: 컴퓨터\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\{ProductName} var reg32 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); RegistryKey reg32Sub = reg32.CreateSubKey("SOFTWARE").CreateSubKey(ProductName); reg32Sub.SetValue("key", "32bit_key"); // 값 추가 reg32Sub.GetValue("key") // 값 조회 reg32Sub.DeleteValue("key"); // 값 삭제 64비트 레지스트리 등록, 조회, 삭제 //..

프로그래밍/C# 2023.03.23

[C#] 참조 없이 인스턴스 생성하는 방법

exe, dll 파일 참조 없이 인스턴스 생성하는 방법 Activator.CreateInstance함수를 사용하면 된다. // // Activator.CreateInstance(assemblyName, typeName) // assemblyName: 파일이름 (확장자를 제외한 파일명) // typeName: 네임스페이스 포함 클래스명 // ObjectHandle handle = Activator.CreateInstance("WindowsFormsApp1", "WindowsFormsApp1.Form1"); Form form = (Form)handle.Unwrap(); 샘플

프로그래밍/C# 2023.03.21
반응형