MaskedTextBox.SelectAll()でテキスト内の文字列が全選択状態にならない時の回避方法を以下にメモ
1 | this .maskedTextBox1.Focus(); |
2 | this .maskedTextBox1.SelectAll(); |
一度フォーカスを当ててからSelectAllを実行すると全選択状態になる。
ただし、上記の方法でも選択状態にならない場合がある。(どうゆうときかは未確認・・・。)
そうゆう場合は以下のようにする。
1 | this .maskedTextBox1.Focus(); |
2 | SendKeys.Send( "{HOME}" ); |
3 | SendKeys.Send( "+{END}" ); |
これでなんとか全選択状態にできる。