본문 바로가기

C#19

C# WPF DatePicker 활용하기 자 오늘은 위와 같이 DatePicker 를 이용하여 날짜를 입력할 수 있는 예제를 준비해 봤습니다. 1) 먼저 위 형태의 화면 레이아웃을 만들기 위한 xaml 파일 내용입니다.                           Foreground="Gray"/>                            Margin="0 2 0 0" Height="23" SelectedDate="{Binding SelectedDateTime}">                                                                                                 //현재 날짜를 기본을 띄워주기 위한 내용                                  .. 2023. 5. 16.
C# WPF Popup Window 띄우기 C# WPF Popup Window 를 띄우기 위해서는 아래와 같이 할 수 있습니다.1.먼저 팝업 용 윈도우 클래스를 생성합니다. 2.xaml 파일에 아래와 같이 팝업 창을 띄우기 위한 버튼을 생성합니다.                                                                    Margin="-30 0 0 0" Background="White" Style="{StaticResource topButton}"                                                             Click="btnBankcd_Click" >                                                       .. 2023. 5. 16.
C# DataGridView 꾸미기 C# Winform에서 DataGridView의 단순한 모양이 마음에 안 드신다면아래의 방법을 활용해 DataGridView를 꾸미실 수 있습니다.    1) AlternatingRowsDefault 속성에서 DataGridViewCellStyle{} 도움창을 열어 BackColor를 설정합니다.예) 238,239,249    2) BorderStyle 속성을 None 으로 설정합니다.    3) CellBorderStyle 속성을 SingleHorizontal 로 설정합니다.    4) ColumnHeadersDefault 속성에서 DataGridViewCellStyle{} 도움창을 열어 BackColor와 ForeColor를 설정합니다.예) BackColor : 20,25,70(남색 계통) 또는 98.. 2023. 5. 16.
C#에서 DataGridView 폰트 지정 방법 C# 에서 사용하는 DataGridView의 폰트는 각각의 부분에 지정할 수 있습니다.    1) 전체 폰트 적용this.dataGridView1.Font = new Font("굴림", 9, FontStyle.Regular);    2) Colum 헤더 부분 적용this.dataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font("굴림", 9, FontStyle.Bold);    3) Row 헤더 부분 적용this.dataGridView1.RowHeadersDefaultCellStyle.Font = new Font("굴림", 9, FontStyle.Bold);    4) Cell 내용 부분 적용this.dataGridView1.DefaultCellStyle.. 2023. 5. 16.