ComboBox の WndProc をオーバーライドし、独自のコンボ ボックスを描画しています。コード スニペットを以下に示します。
Protected Overrides Sub WndProc(ByRef m As Message)
MyBase.WndProc(m)
Select Case m.Msg
Case &HF
Dim g As Graphics = Me.CreateGraphics
If ComboBoxRenderer.IsSupported Then
Dim pTextBoxRect As New Rectangle(Me.ClientRectangle.X, Me.ClientRectangle.Y, Me.ClientRectangle.Width, Me.ClientRectangle.Height)
ComboBoxRenderer.DrawTextBox(g, pTextBoxRect, _tbState)
' .... and so on
End Select
End Sub
描画されたコンボ ボックスが古い描画に重なっているだけなので、古いコントロールはまだ描画されています。デフォルトのコンボボックスの描画を止める方法はありますか?
ありがとう、ロブ