Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
TabPage を拡張して、アクティブなタブに X が表示されるようにする方法を誰かが知っていますか?
ありがとう
カスタム描画を実装するには、TabControl.DrawMode プロパティを使用します。MSDN ライブラリの記事に、DrawItem イベント ハンドラーの良い例があります。Graphics.DrawLine() または DrawImage を使用して x を描画します。x のクリックを検出するには、MouseUp イベントを使用します。どのタブがクリックされたかを調べるには、GetTabRect() メソッドが必要です。そして、場所を絞り込んで×付近にあることを確認。