본문 바로가기
728x90
반응형

C#12

[Xamarin, c#, UWP] UWP, How to Disable Caret Browsing in code(key F7), Disable Cursor Browsing in uwp app uwp 앱에서 코딩을 하지않아도 F7 키를 누르면 위와 같은 메시지가 뜬다. 앱 내에서 keydown , keyup 이벤트를 써도 메시지가 뜬다. 하지만 Window.Current.Dispatcher.AcceleratorKeyActivated 이벤트를 받아서 handled = true로 해주면 메시지가 뜨기전에 키보드를 잡을 수 있다. If you press F7 even if you do not code in the uwp app, the above message appears. Even if you use keydown and keyup events within the app, a message appears. but If you receive the Window.Current.Dispatcher.A.. 2022. 10. 11.
[Xamarin] KeyDownEvent fires twice on Android public override bool OnKeyDown([GeneratedEnum] Keycode keyCode, KeyEvent e) { base.OnKeyDown(keyCode, e); // work return true; } // or public override bool DispatchKeyEvent(KeyEvent e) { base.DispatchKeyEvent(e); // work if (e.Action == KeyEventActions.Up) { KeyEventClass.CurrentHandler?.OnKeyUpEvent(e.ScanCode); } return true; } If you don't turn on the number lock, there are times when Android.. 2022. 8. 10.
[UWP] 풀스크린 모드로 변경 및 풀스크린 모드(FullScreen & Mode) ApplicationView.GetForCurrentView().FullScreenSystemOverlayMode = FullScreenSystemOverlayMode.Minimal; ApplicationView.GetForCurrentView().FullScreenSystemOverlayMode = FullScreenSystemOverlayMode.Standard; ApplicationView.GetForCurrentView().TryEnterFullScreenMode(); 전체 화면 모드에서 앱이 에지 제스처에 응답하는 방법을 지정하는 상수 ApplicationView.GetForCurrentView().TryEnterFullScreenMode(); 화면을 풀스크린 모드로 변경 FullScreenSy.. 2022. 6. 7.
[Xamarin] How to open another app with data Xamarin] How to open another app. [Xamarin] How to open another app. How to open another app in Xamarin. Use PackageManager in ~.Android project [assembly: Xamarin.Forms.Dependency(typeof(AppLinkService))] namespace MyApp.Droid.Service { public class AppLinkService :.. something-is-code.tistory.com [assembly: Xamarin.Forms.Dependency(typeof(AppLinkService))] namespace MyApp.Droid.Service { publi.. 2021. 12. 22.
[Xamarin] How to open another app. How to open another app in Xamarin. Use PackageManager in ~.Android project [assembly: Xamarin.Forms.Dependency(typeof(AppLinkService))] namespace MyApp.Droid.Service { public class AppLinkService : IServiceAppLink { public Task LaunchApp(string packageName) { bool result = false; try { PackageManager pm = Android.App.Application.Context.PackageManager; var activity = Xamarin.Essentials.Platform.. 2021. 12. 22.
[c#] CreateParams 사용 protected override CreateParams CreateParams { get { CreateParams createParams = base.CreateParams; createParams.ExStyle |= properties return createParams; } } properties 종류 (생각날 때 계속 추가예정) WM_NOACTIVATE = 0x8000000L; CreateParams 속성을 사용해 포커스 설정 방지하기 WS_EX_TOOLWINDOW = 0x80; 어플리케이션 숨기기 (알트탭해도 안보이기) CS_DROPSHADOW = 0x00020000; 폼의 그림자 넣고 빼기 WS_EX_COMPOSITED = 0x2000000; 화면 갱신 플리커 해결(깜박임 제거) protec.. 2021. 1. 28.
[c#] Region, 소스정리 #region 정리요약 이름 #endregion region ~ endregion 사이 내용을 접었다가 펼 수 있다. 소스 관리쉬워짐 2021. 1. 28.
[c#] string.Format 서식 서식항목 {index[,alignment][:formatString]} var value = String.Format("{0,-10:C}", 126347.89m); Console.WriteLine(value); index 문자열 표현이 문자열의이 위치에 포함 될 인수의 인덱스 (0부터 시작)입니다. 이 인수가 이면 null 문자열의이 위치에 빈 문자열이 포함 됩니다. Alignment 선택 사항입니다. 인수가 삽입 되는 필드의 전체 길이와 오른쪽에 맞출지 (양의 정수) 아니면 왼쪽 맞춤 (음의 정수)을 나타내는 부호 있는 정수입니다. 맞춤 을 생략 하면 해당 인수의 문자열 표현이 선행 또는 후행 공백이 없는 필드에 삽입 됩니다. Alignment 의 값이 삽입할 인수의 길이 보다 작은 경우 맞춤 은 무시.. 2021. 1. 26.
[c#] 프로그램 시작시 중복 체크 [DllImport("user32")] private static extern bool SetForegroundWindow(IntPtr handle); [DllImport("User32")] private static extern int ShowWindow(IntPtr hwnd, int nCmdShow); [DllImport("User32")] private static extern void BringWindowToTop(IntPtr hwnd); // 중복실행방지 var processName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; var processList = System.Diagnostics.Process.GetProc.. 2021. 1. 12.
728x90
반응형