What is the way to implement/mimic the Windows message popup that a user gets when, for instance when you try to rename a folder on the desktop using invalid characters?
I want to use this method in lieu of a message box.
What is the way to implement/mimic the Windows message popup that a user gets when, for instance when you try to rename a folder on the desktop using invalid characters?
I want to use this method in lieu of a message box.
You can achieve this by using ErrorProvider
. It is located in your toolbox. Just drag and drop it into your form. To use it, example code
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text.Trim().Length > 6 Then
ErrorProvider1.SetError(TextBox1, "Input is too long!")
End If
End Sub
Method 2 : Using ToolTip
. This can be found in your toolbox as well. Just drop it into your form and in the properties window, you can set the "tip" for each controls in your form.
Here is how it will look like when your cursor is hovering the controls.
If you dislike the rectangle pop up, you can change it to a ballon pop up by isBallon = true
.