본문 바로가기

Windows/WPF5

WPF, C# 출력창에 메시지 출력하기. Console.WriteLine C# Code Console.WriteLine(); * 사용방식은 C,C++의 TRACE와 동일한 듯.* printf 쓰듯 쓰면 된다 MSDNhttps://msdn.microsoft.com/ko-kr/library/system.console.writeline(v=vs.110).aspx 2015. 11. 18.
WPF, C# 엑셀(excel) 파일을 DataGrid에 가져오기 Header using Microsoft.Win32; using Excel = Microsoft.Office.Interop.Excel; using System.Data; C# Code private void btnOpenFile_Click(object sender, RoutedEventArgs e) { OpenFileDialog oFileDialog = new OpenFileDialog(); oFileDialog.Filter = "Excel (*.xlsx)|*.xlsx|Excel 97-2003 (*.xls)|*.xls"; if (oFileDialog.ShowDialog() == false) { return; } Excel.Application xlApp; Excel.Workbook xlWorkBook; .. 2015. 11. 16.
WPF, C# 파일 다이로그, OpenFileDialog Headerusing Microsoft.Win32; C# Code private void oFile() { OpenFileDialog oFileDialog = new OpenFileDialog(); oFileDialog.Filter = "Excel (*.xlsx)|*.xlsx|Excel 97-2003 (*.xls)|*.xls"; if (oFileDialog.ShowDialog() == true) { MessageBox.Show("선택한 파일:" + oFileDialog.FileName); } } 2015. 11. 16.
WPF, C# Excel 파일 불러오기 http://csharp.net-informations.com/excel/csharp-open-excel.htm위 링크의 글을 보고 재정리 하였음. 준비- 추가 > 참조 > Microsoft Excel Object Library (포스트 작성시 Excel 15.0, 1.8버전 )- cs 파일 상단에 using Excel = Microsoft.Office.Interop.Excel; 추가 C# code private void readExcel() { Excel.Application xlApp; Excel.Workbook xlWorkBook; Excel.Worksheet xlWorkSheet; Excel.Range range; string str; int rCnt = 0; // 열 갯수 int cCnt = 0.. 2015. 11. 16.
WPF, C# ListBox 아이템 추가하기 listBox.Items.Add(obejct); *.xaml *.cslistBox.Items.Add("Items") !Add 메서드의 매개변수를 obejct로 받기에 대량으로 추가 할 경우 성능에 부담이 갈 수 있다. 2015. 11. 5.
320x100