본문 바로가기

전체 글30

IProgress<T>로 진행상황 표시하기 async Task MyMethodAsync(IProgress progress = null) { bool done = false; double percentComplete = 0; while (!done) { progress?.Report(percentComplete); } } async Task CallMyMethodAsync() { var progress = new Progress(); progress.ProgressChanged += (sender, args) => { // Report 메소드를 실행할 때마다 args로 해당 퍼센트가 넘어온다. // 여기에서 필요한 상태를 표시하면 된다. }; await MyMotherAsync(progress);; } 2023. 5. 25.
스프레드 내용에서 문자 검색 // 현재 검색에서 행 위치 지정하기 // 범위 검색이기 때문에 범위 검색의 시작 위치를 지정하기 위해서 사용한다. private int SearchedRowIndex = 0 private void txtSearchSkuFullNM_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { // 초기화 int refRowIndex = -1, refColumnIndex = -1; SearchFoundFlags result; // 순환 검색을 위해서 반복문 사용함. while (true) { // 반드시 범위검색 조건을 true로 해야만 해당 컬럼에서만 검색을 처리한다. result = sprFSOR02.Search(0, txtSearch.. 2022. 7. 25.
변경된 바인딩의 필터 다시 적용하기 // DataSource 정보가 변경되어서 현재 화면에 보여주는 내용이 변경되는 경우 // 변경된 내용을 현재의 필터로 다시 재구성하는 작업을 함. sprProductListSheet.InvalidateRowFilter(true, true); 원본 정보가 변경된 경우 소스 코드로 필터를 다시 적용하기 2022. 6. 27.
필터된 SheetView에서 클립보드 복사하기 스프레드에서 지원하는 방법 FarPoint.Win.Spread.InputMap im = sprEmpCalculte.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused); im.Put(new FarPoint.Win.Spread.Keystroke(Keys.C, Keys.Control), FarPoint.Win.Spread.SpreadActions.ClipboardCopyAsStringSkipHidden); // 핵심은 이 부분 수동으로 처리하는 방법 KeyDown 이벤트 처리 private void sprPurchaseDetail_KeyDown(object sender, KeyEventArgs e) { // Ctrl + C if (e.Control && e... 2022. 6. 2.