C# textbox 커서 위치
처음 textBox1.Select(0, 0); 마지막 textBox1.Select(textBox1.Text.Length, 0);
- C# Programming
- · 2021. 11. 1.
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);
new Thread(() => { for (int i = 0; i < 10000000; i++) { items[0].Time = i.ToString(); if(i == 9999999) { dataGridView1.Invalidate(); } } } ).Start();
private Rectangle dragBoxFromMouseDown; private int rowIndexFromMouseDown; private int rowIndexOfItemUnderMouseToDrop; private void ItemGrid_MouseMove(object sender, MouseEventArgs e) { if ((e.Button & MouseButtons.Left) == MouseButtons.Left) { if (dragBoxFromMouseDown != Rectangle.Empty && !dragBoxFromMouseDown.Contains(e.X, e.Y)) { DragDropEffects dropEffect = Condition1Grid.DoDragDrop(Conditi..
private Point mousePoint; // 현재 마우스 포인터의 좌표저장 변수 선언 // 마우스 누를때 현재 마우스 좌표를 저장한다 private void Form1_MouseDown(object sender, MouseEventArgs e) { mousePoint = new Point(e.X, e.Y); //현재 마우스 좌표 저장 } // 마우스 왼쪽 버튼을 누르고 움직이면 폼을 이동시킨다 private void Form1_MouseMove(object sender, MouseEventArgs e) { if ((e.Button & MouseButtons.Left) == MouseButtons.Left) //마우스 왼쪽 클릭 시에만 실행 { //폼의 위치를 드래그중인 마우스의 좌표로 이동 Loc..
private Rectangle dragBoxFromMouseDown; private int rowIndexFromMouseDown; private int rowIndexOfItemUnderMouseToDrop; private void ItemGrid_MouseMove(object sender, MouseEventArgs e) { if ((e.Button & MouseButtons.Left) == MouseButtons.Left) { if (dragBoxFromMouseDown != Rectangle.Empty && !dragBoxFromMouseDown.Contains(e.X, e.Y)) { DragDropEffects dropEffect = ItemGrid.DoDragDrop(ItemGrid.Rows..