[개발] C#, .Net
-
SortedDictionary는 C#의 컬렉션 중 하나로, 키-값 쌍을 저장하고 키를 기준으로 정렬된 순서로 데이터를 유지하는 사전(dictionary)입니다. . NET의 System.Collections.Generic 네임스페이스에 속해 있습니다. SortedDictionary는 이진 검색 트리(BST)를 기반으로 하며, 키가 항상 오름차순으로 정렬됩니다. using System;using System.Collections.Generic;class Program{ static void Main() { // SortedDictionary 선언 및 초기화 SortedDictionary sortedDict = new SortedDictionary(); /..
[C#] SortedDictionary 란?SortedDictionary는 C#의 컬렉션 중 하나로, 키-값 쌍을 저장하고 키를 기준으로 정렬된 순서로 데이터를 유지하는 사전(dictionary)입니다. . NET의 System.Collections.Generic 네임스페이스에 속해 있습니다. SortedDictionary는 이진 검색 트리(BST)를 기반으로 하며, 키가 항상 오름차순으로 정렬됩니다. using System;using System.Collections.Generic;class Program{ static void Main() { // SortedDictionary 선언 및 초기화 SortedDictionary sortedDict = new SortedDictionary(); /..
2024.05.29 -
string msg = ""; msg += "\r\n"; msg += $@"{Convert.ToString(fpSpread2.Sheets[0].Cells[0, 0].Value)} : {Convert.ToString(fpSpread2.Sheets[0].Cells[0, 1].Value)}"; msg += "\r\n"; msg += "을 삭제하시겠습니까?";$@ 가 선언된 줄에서 개행을 선언하는 경우 인식 안됌 msg += "\r\n";이런 식으로 따로 빼주어서 선언해주어야 함.
[C#] 문자열 개행, 줄바꿈 참고 코드string msg = ""; msg += "\r\n"; msg += $@"{Convert.ToString(fpSpread2.Sheets[0].Cells[0, 0].Value)} : {Convert.ToString(fpSpread2.Sheets[0].Cells[0, 1].Value)}"; msg += "\r\n"; msg += "을 삭제하시겠습니까?";$@ 가 선언된 줄에서 개행을 선언하는 경우 인식 안됌 msg += "\r\n";이런 식으로 따로 빼주어서 선언해주어야 함.
2024.05.29 -
C#에서 long과 decimal은 서로 다른 데이터 형식입니다.long: 이것은 정수 데이터 형식으로, 64비트 정수를 나타냅니다. long 변수는 대략 ±9,223,372,036,854,775,808 (-9,223경에서 9,223경까지)의 값을 표현할 수 있습니다.decimal: 이것은 십진수 데이터 형식으로, 부동 소수점 수를 나타냅니다. decimal은 금융 애플리케이션과 같이 정확한 소수점 연산이 필요한 곳에서 사용됩니다. 이는 정밀한 계산을 위해 고안되었으며, 소수점 이하 28자리까지의 숫자를 저장할 수 있습니다.이 두 형식은 다른 사용 사례에 적합합니다.long은 정수를 다룰 때 주로 사용되며, decimal은 정확한 소수점 연산이 필요한 경우에 사용됩니다.
[C#] long, decimal 차이C#에서 long과 decimal은 서로 다른 데이터 형식입니다.long: 이것은 정수 데이터 형식으로, 64비트 정수를 나타냅니다. long 변수는 대략 ±9,223,372,036,854,775,808 (-9,223경에서 9,223경까지)의 값을 표현할 수 있습니다.decimal: 이것은 십진수 데이터 형식으로, 부동 소수점 수를 나타냅니다. decimal은 금융 애플리케이션과 같이 정확한 소수점 연산이 필요한 곳에서 사용됩니다. 이는 정밀한 계산을 위해 고안되었으며, 소수점 이하 28자리까지의 숫자를 저장할 수 있습니다.이 두 형식은 다른 사용 사례에 적합합니다.long은 정수를 다룰 때 주로 사용되며, decimal은 정확한 소수점 연산이 필요한 경우에 사용됩니다.
2024.05.29 -
Spread 편집모드에서 셀 입력 후 다음 셀로 커서 이동하는 참고코드private void fpSpread1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { int row = fpSpread1.ActiveSheet.ActiveRowIndex; int col = fpSpread1.ActiveSheet.ActiveColumnIndex; int initialRow = row; int initialCol = col; if(col == 1) ..
[C#, .Net, Spread] 엔터 입력 시 다음 셀로 커서 이동하는 참고 코드Spread 편집모드에서 셀 입력 후 다음 셀로 커서 이동하는 참고코드private void fpSpread1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { int row = fpSpread1.ActiveSheet.ActiveRowIndex; int col = fpSpread1.ActiveSheet.ActiveColumnIndex; int initialRow = row; int initialCol = col; if(col == 1) ..
2024.05.29 -
파일 중에 Designer.cs> InitializeComponent 메서드에서 맨 상위 컨트롤 접근 ( 맨 아래에 있음 )// "Primary Controller";this.Controls.Add(this.panel4);this.Controls.Add(this.textBox67);this.Controls.Add(this.panel3);this.Controls.Add(this.panel2);this.Controls.Add(this.pnlInfo);this.Name = "Primary Controller";this.Text = "최상위 컨트롤러";this.Controls.SetChildIndex(this.panel99, 0);this.Controls.SetChildIndex(this.panel2, 0);t..
[C#, .Net] Panel 패널 맨 앞으로, 맨 위로 설정하는 코드파일 중에 Designer.cs> InitializeComponent 메서드에서 맨 상위 컨트롤 접근 ( 맨 아래에 있음 )// "Primary Controller";this.Controls.Add(this.panel4);this.Controls.Add(this.textBox67);this.Controls.Add(this.panel3);this.Controls.Add(this.panel2);this.Controls.Add(this.pnlInfo);this.Name = "Primary Controller";this.Text = "최상위 컨트롤러";this.Controls.SetChildIndex(this.panel99, 0);this.Controls.SetChildIndex(this.panel2, 0);t..
2024.05.29 -
텍스트박스에 textChanged이벤트 걸어서 사용하는 월 세팅 예시) 1 입력시 01로 치환 3 입력시 03으로 치환 12 입력시 그대로 12 / 1~12이외의 숫자 입력 시 메시지 박스 private void ValidateAndFormatMonthComboBox(ComboBox comboBox) { var tempStr = comboBox.Text; if (!string.IsNullOrWhiteSpace(tempStr) && !tempStr.All(char.IsDigit)) { comboBox.Text = ""; return; } if (int.TryParse(tempStr, out int month)) { if (month >= 1 && month
[C#] 텍스트 박스 입력 시 자동 월 세팅 참고 코드 / ex. 2 > 02텍스트박스에 textChanged이벤트 걸어서 사용하는 월 세팅 예시) 1 입력시 01로 치환 3 입력시 03으로 치환 12 입력시 그대로 12 / 1~12이외의 숫자 입력 시 메시지 박스 private void ValidateAndFormatMonthComboBox(ComboBox comboBox) { var tempStr = comboBox.Text; if (!string.IsNullOrWhiteSpace(tempStr) && !tempStr.All(char.IsDigit)) { comboBox.Text = ""; return; } if (int.TryParse(tempStr, out int month)) { if (month >= 1 && month
2024.04.10