想自定义个TextBox控件,如图中所示,已经重写了WndProc()方法,
主要代码为
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
MyBase.WndProc(m)
If (m.Msg = WM_PAINT) Then
Using g = Graphics.FromHwnd(Me.Handle)
Dim pen As Pen = New Pen(Color.Red)
g.DrawString("*", Font, Brushes.Red,- 5, 10)
End Using
End If
End Sub
但是“*”号不显示啊。我猜测是工作区的大小调整问题,可是不会整啊。