C# textbox 커서 위치
처음 textBox1.Select(0, 0); 마지막 textBox1.Select(textBox1.Text.Length, 0);
- C# Programming
- · 2021. 11. 1.
#메모리는 스택영역과 힙영역이 있다 #Switch 식 - switch문을 사용할때 조건에 따라 단순히 데이터 입력하는 것이라면 다음과 같이 사용할 수 있다 string grade = score switch { 90 => "A", 80 => "B", 70 => "C", 60 => "D", _ => "F", }
using System.Reflection; using System.Windows.Forms; namespace WindowsFormsApp1 { public static class Extensions { public static void DoubleBuffered(this Control control, bool enabled) { var prop = control.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic); prop.SetValue(control, enabled, null); } } }
using System.Drawing; using System.Windows.Forms; namespace WindowsFormsApp1 { internal class FlickerFreeListBox : ListBox { public FlickerFreeListBox() { this.SetStyle( ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); this.DrawMode = DrawMode.OwnerDrawFixed; } protected override void OnDrawItem(DrawItemEventArgs e) { if (this.Items.Count > 0) { ..
void StyleDatagridview(DataGridView dgv) { dgv.AllowUserToResizeColumns = false; dgv.AllowUserToResizeRows = false; dgv.RowHeadersVisible = false; dgv.EnableHeadersVisualStyles = false; dgv.MultiSelect = false; dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dgv.BorderStyle = BorderStyle.None; dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(238,239,249); dgv.CellBorde..
protected override void WndProc(ref Message m) { const int RESIZE_HANDLE_SIZE = 10; switch (m.Msg) { case 0x0084/*NCHITTEST*/ : base.WndProc(ref m); if ((int)m.Result == 0x01/*HTCLIENT*/) { Point screenPoint = new Point(m.LParam.ToInt32()); Point clientPoint = this.PointToClient(screenPoint); if (clientPoint.Y
처음 textBox1.Select(0, 0); 마지막 textBox1.Select(textBox1.Text.Length, 0);