WPF/코드(21)
-
WPF___백그라운드 프로세서 종료
Environment.Exit(0); System.Diagnostics.Process.GetCurrentProcess().Kill();
2020.02.17 -
WPF___Enum 반복 ( 나열 된 수 만큼 반복 )
e_pam_run.cs using System.Windows; namespace WPF { public partial class MainWindow : Window { public enum e_pam_run { /* Diagnostics */ VERSION, REGISTER_ACCESS, REGISTER_DUMP, REGISTER_DUMP_ALL, LINK_STATUS, SNR_MONITOR, FEC_STATS, /* Initialization */ INIT_MISSION, INIT_CORE_PRBS, INIT_LINE_PRBS, INIT_HOST_PRBS, INIT_LOOPBACK, /* PRBS checker examples */ LINE_PRBS_CHECKER_STATUS_COMBINED, LINE..
2020.02.17 -
WPF___Oxyplot
https://stac koverflow.com/questions/32697963/wpf-plotting-a-cosine-function-when-radiobutton-is-clicked WPF 프로젝트 만들기 프로젝트 -> NuGet 패키지 관리 찾아보기 클릭 -> oxyplot 검색 검색 항목중 OxyPlot.Wpf 선택 -> 설치 설치가 완료 - 참조 항목 확인 File Name : "MainWindow.xmal" File Name : "MainPlotView.cs" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using OxyPlot; ..
2020.02.17 -
TextBox___Cursor 끝으로 보내기
/** Cursor 마지막 선택 */ txt.SelectionStart = txt.Text.Length;
2020.02.17 -
WPF___TextBox 현재 커서 라인 구하기
int line = textBox1.GetLineFromCharIndex(textBox1.SelectionStart); int column = textBox1.SelectionStart - textBox1.GetFirstCharIndexFromLine(line);
2020.02.17 -
Paste___DataObjectPastingEventArgs
/** txt_cmd - User TextBox */ /** Variable */ private bool _isPaste; private _strPasteText = null; /** 이벤트 등록 */ DataObject.AddPastingHandler(txt_Cmd, txt_Cmd_OnPaste); /** 붙여넣기 했을 때 발생 */ private void txt_Cmd_OnPaste(object sender, DataObjectPastingEventArgs e) { /** 붙여넣기 했냐 ? true or false */ _isPaste = e.SourceDataObject.GetDataPresent(DataFormats.UnicodeText, true); /** 붙여넣기한 텍스트 */ _strPast..
2020.02.17 -
WPF___Image 삽입
public class Utils { /// /// BitmapSource - 이미지 경로 지정 /// /// 이미지 경로 /// BitmapSource public BitmapSource BS(string path) { Uri imageUri = new Uri(string.Format(System.IO.Path.Combine(@"/", path), 0), UriKind.Relative); BitmapSource _bs = new BitmapImage(imageUri); return _bs; } } *.cs ----------------------------------------------------------------------------------- Utils utils = new Utils(); ..
2020.02.17 -
TextBox 붙여넣기 허용
WPF 텍스트 상자에 ‘데이터 붙여 넣기’허용 시간: 2019-05-31 16:34:56.0태그:c-2 clipboard wpf 번역: 출처번역 교정 WPF 텍스트 상자에 데이터를 붙여 넣으려고합니다. 예를 들어 사용자는 Windows snipping 도구를 사용하여 화면 캡처를 만들고, 자동으로 이미지 데이터를 클립 보드에 저장합니다. 여기에있는 아이디어는 사용자가 TextBox에서 CTRL V를 사용하여 가로 챌 수 있도록 허용하고, 텍스트 상자가 맞는지 확인합니다. 데이터를 가져 와서 내가 원하는대로 할 수 있습니다. public class PasteBehavior : Behavior { protected override void OnAttached() { base.OnAttached(); Data..
2020.01.15 -
User Exception ( example code. dll files )
사용자가 원할 때 예외처리를 할 수 있도록 한다. 아래 구문은 dll 구성 중 사용자가 예외처리할 수 있는 코드이다. 아래 구문은 지정된 시간동안 수신 데이터가 없으면 "Timeout" 이 발생하도록 하는 코드이다. "throw new" 구문일 이용 하여 위에서 작성된 예외처리 함수를 불러와 사용 할 수 있다. 발생한 예외처리는 Windows Fowm 사용한 것과 동일하다. 밑에와 같이 사용하면 된다. try { //... 예외처리 코드 } catch(Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); }
2020.01.10 -
Delegate
using System.Windows.Threading; Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate { txt_Msg.AppendText(strMsg); }));
2020.01.09