問題
ListViewにアイテムを登録して、実際に選択してみると1列目の左端しか選択状態にならない。
別に動作的には問題ないのですが、なんかUI的には気持ち悪いですね。

というわけで、選択範囲を横いっぱいにしたいと思います。
解決方法
とはいえ、めっちゃ簡単に対応できます。
ListViewの「FullRowSelect」というプロパティをtrueにするだけです。

デフォルトはfalseです。
変更して実行してみましょう。

はい、解決です。
ちなみに、コードで書くとこんな感じ。
lv_main.FullRowSelect = true;
とても簡単ですね。

確かな力が身につくC#「超」入門 (Informatics&IDEA)
コメント