views:

476

answers:

2

Is it possible to force a textbox in a windows forms application to work in "overwrite mode", i.e. have characters replaced when the user types instead of added?
Otherwise, is there a standard way to get this behavior?

+5  A: 

Try using a MaskedTextBox and set InsertKeyMode to InsertKeyMode.Overwrite.

MaskedTextBox box = ...;
box.InsertKeyMode = InsertKeyMode.Overwrite;
JaredPar
+1  A: 

Standard way would be to select the existing text as you land in the textbox, then as the user types it will automatically replace the existing text

PaulG