Is there an easy way to Create/Delete/Move files in the Windows File System?
Use File.Create, Delete and Move static methods.
How can I move rows by dragging the row header cell
One way to implement this is to derive a DataGrid and override the virtual OnMouseDown, OnMouseMove and OnMouseUp methods. In your overrides, if the mousedown is on a row header, track the initial mousedown row, and as it moves, draw a line to indicate a target position. Then on the mouseup, handle moving the row. You can download a sample (C#, VB) that illustrates how this might be done.
How can I place a TextBox in overwrite mode instead of insert mode
You can handle the textbox’s KeyPress event and if you want the keypress to be an overwrite, just select the current character so the keypress will replace it. The attached sample has a derived textbox that has an OverWrite property and a right-click menu that allows you to toggle this property. The snippet below shows you a KeyPress handler that automatically does an overwrite if the maxlength of the textbox has been hit. This does not require a derived class. private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if(textBox1.Text.Length == textBox1.MaxLength && textBox1.SelectedText == '''') { textBox1.SelectionLength = 1; } }
How can I get the selected text in an active gridcell
You need to get the DataGridTextBoxColumn.TextBox member, and retrieve the SelectedText from it for the active cell. The sample shows how you can do this as part of handling this TextBox’s rightClick. This code assumes you have specifically added DataGridTextBoxColumn for each column style. You can also download a VB sample. private void HandleMouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if(e.Button == MouseButtons.Right) { DataGridTableStyle ts = dataGrid1.TableStyles[''customers'']; DataGridTextBoxColumn cs = (DataGridTextBoxColumn)ts.GridColumnStyles[dataGrid1.CurrentCell.ColumnNumber]; MessageBox.Show(''Selected: '' + cs.TextBox.SelectedText); } }
How can I use a TextBox to enter a password
Set the TextBox.PasswordChar property for the textbox. textBox1.PasswordChar = ’\u25CF’;