Visual Studio C# 2010 でタブページ コントロールに背景画像を割り当てるにはどうすればよいですか? 各タブに個別に背景画像を提供することはできますが、タブページ コントロールの一部が異なる背景のままであり、各タブ ページの背景が適切であるため、タブページ コントロール全体に対しては提供できません。
これが私のフォームの写真です:
タブ行の「灰色」の領域を参照してください。タブページ コントロール全体を 1 つの背景でカバーするにはどうすればよいですか?
Visual Studio C# 2010 でタブページ コントロールに背景画像を割り当てるにはどうすればよいですか? 各タブに個別に背景画像を提供することはできますが、タブページ コントロールの一部が異なる背景のままであり、各タブ ページの背景が適切であるため、タブページ コントロール全体に対しては提供できません。
これが私のフォームの写真です:
タブ行の「灰色」の領域を参照してください。タブページ コントロール全体を 1 つの背景でカバーするにはどうすればよいですか?
The header area that contains the tabs is not part of your tab page. It's part of the parent TabControl
, which is automatically drawn for you by Windows.
If you want to change how it looks, you'll have to draw it yourself. That's called owner-drawing, and it's not exactly a trivial undertaking, especially for a complicated control like this one. For starters, you can't just use OwnerDrawFixed
, because that just allows you to custom draw the contents of the tabs (for example, to change the font). You will need to owner draw the entire tab control.
I can't imagine a good reason that you would ever want do this, but you'll find a few samples online that might help get you started. For example: