Tutorial by Examples

var source = new AutoCompleteStringCollection(); // Add your collection of strings. source.AddRange(new[] { "Guybrush Threepwood", "LeChuck" }); var textBox = new TextBox { AutoCompleteCustomSource = source, AutoCompleteMode = AutoCompleteMode.SuggestAppend, ...
textBox.KeyPress += (sender, e) => e.Handled = !char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar); This will only permit the use of digits and control characters in the TextBox, other combinations are possible using the same approach of setting the Handle property to true to block ...
textBox.SelectionStart = textBox.TextLength; textBox.ScrollToCaret(); Applying the same principle, SelectionStart can be set to 0 to scroll to the top or to a specific number to go to a specific character.
This code places the hint text at form load and manipulates it as follows: C# private void Form_load(object sender, EventArgs e) { textBox.Text = "Place Holder text..."; } private void textBox_Enter(object sender, EventArgs e) { if(textBox.Text == "Place Holder text....

Page 1 of 1