TextBox Border Blue Color, когда пусто, затем Border Color Red vb.net Я использую приведенный ниже код, но не работаю
Private Sub Form1_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim p As New Pen(Color.Blue, 2)
e.Graphics.DrawRectangle(p, New Rectangle(TextBox1.Location + New Size(1, 1), TextBox1.Size - New Size(2, 2)))
p.Dispose()
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then
TextBox1.Region = New Region(New Rectangle(2, 2, TextBox1.Width - 4, TextBox1.Height - 4))
Else
End If
End Sub