| 分類:[VB.NET/VB2005 以降]
開発環境は、VB2019、.Net4.7.2、Windows10、Windowsフォームアプリケーションです。
Windows7時代に開発したアプリでComboBoxRenderer.DrawDropDownButtonで描画している箇所があります。 Windows10になってVisualStyles.ComboBoxStateの違いによる差があまりなく、わかりにくくなりました。(私的感覚ですが・・・) VisualStyles.ComboBoxState.Pressedの場合にボタン表面をColor色で描画したり、OSのテーマ変更でもっと目立つようにできないでしょうか?
以下は実験用のコードです。 実際の実装はDataGridViewのヘッダに描画していて、SortやFilterが適用されている場合に、VisualStyles.ComboBoxState.Pressedで描画しています。
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim g As Graphics = Me.CreateGraphics Dim rect0 As New Rectangle(0, 0, 32, 32) Dim rect1 As New Rectangle(40, 0, 32, 32) Dim rect2 As New Rectangle(80, 0, 32, 32) ComboBoxRenderer.DrawDropDownButton(g, rect0, VisualStyles.ComboBoxState.Normal) ComboBoxRenderer.DrawDropDownButton(g, rect1, VisualStyles.ComboBoxState.Hot) ComboBoxRenderer.DrawDropDownButton(g, rect2, VisualStyles.ComboBoxState.Pressed) End Sub |