- [ C# ]Farpoint 리스트 박스2015-10-19 13:05:18FarPoint.Win.Spread.CellType.ListBoxCellType listcell = new FarPoint.Win.Spread.CellType.ListBoxCellType(); listcell.ImageList = ImageList1; listcell.ItemData = new string[] { "One", "Two", "Three"}; listcell.Items = new string[] {"One","Two","Three"}; listcell.ItemHeight = 40; fpSpread1.ActiveSheet.Cells[0, 0].CellType = listcell; [참조] http://helpcentral.componentone.com/NetHelp/SpreadNet7/WF/s..
- [ C# ]winform 화면 프린팅2015-10-19 11:36:00public class Form1 : Form { private Button printButton = new Button(); private PrintDocument printDocument1 = new PrintDocument(); public Form1() { printButton.Text = "Print Form"; printButton.Click += printButton_Click; printDocument1.PrintPage += printDocument1_PrintPage; this.Controls.Add(printButton); } void printButton_Click(object sender, EventArgs e) { CaptureScreen(); printDocument1.Prin..
- [ C# ]C# Delay 함수2015-10-08 08:24:51using system.Threading 을 선언하고 Thread.sleep(3000)을 선언하여 3초를 줄 수 있지만 프로그램이 멈추는 문제가 발생하여 private static DateTime Delay(int MS){ DateTime ThisMoment = DateTime.Now; TimeSpan duration = new TimeSpan(0, 0, 0, 0, MS); DateTime AfterWards = ThisMoment.Add(duration); while (AfterWards >= ThisMoment) { System.Windows.Forms.Application.DoEvents(); ThisMoment = DateTime.Now; } return DateTime.Now;} 함수를 선언하고..
- [ C# ]텍스트 박스 엔터키 이벤트로 버튼 클릭 구현2015-09-22 10:40:02텍스트 박스에서 KeyDown 이벤트를 사용하여 버튼 클릭 구현 private void btnOK_Click(object sender, EventArgs e){ bTextbox.Text = aTextbox.Text;} private void Textbox_KeyDown(object sender, KeyEventArgs e){ if (e.KeyCode == Keys.Enter) { this.btnOK_Click(sender, e); }}텍스트 박스에서 엔터키를 누르면 버튼 클릭효과~!~!
- [ C# ]C# 자료형 변환 Convert.ToDouble 과 double.parse 의 차이2015-09-22 08:13:14double.parse 는 변환할 값이 null이면 null메세지가 나와서 에러가 생기는데 Convert.ToDouble 을 사용하게 되면 null일때 0으로 처리해 준다
- [ C# ]텍스트박스 크기조절2015-09-21 21:35:51Textbox는 autosize가 기본이다. Textbox는 font 크기에 따라 사이즈가 결정된다. Textbox 사이즈를 내맘대로 조정하는 방법에는 3가지 방법이 있다. 1. 폰트 사이즈를 조정한다. 이 방법은 폰트 사이즈 만큼만 조정된다. 개발자 맘대로 조정되지 않는다. 2. MultiLine 속성을 true로 하면 된다. 그러나 이 방법은 문장이 길어지면 다음 라인으로 내려간다는 것이 문제다. 3. TextBoxBase 클래스의 autosize를 재정의 하면 된다. 이 방법을 쓰기 위해서는 textbox를 상속받는 클래스를 정의해야한다.
- [ C# ]rgb, hex 값 변경2015-09-07 09:39:04rgb -> hex http://www.javascripter.net/faq/rgbtohex.htm hex -> rgbhttp://www.javascripter.net/faq/hextorgb.htm
- [ C# ]progress bar 색 변경2015-09-01 14:48:16using System; using System.Windows.Forms; using System.Drawing; public class ProgressBarEx : ProgressBar { private SolidBrush brush = null; public ProgressBarEx() { this.SetStyle(ControlStyles.UserPaint, true); } protected override void OnPaint(PaintEventArgs e) { if (brush == null || brush.Color != this.ForeColor) brush = new SolidBrush(this.ForeColor); Rectangle rec = new Rectangle(0, 0, this...