Tool Tips in VB
Page 1 of 110 Replies - 759 Views - Last Post: 06 September 2012 - 09:58 PM
#1
Tool Tips in VB
Posted 03 September 2012 - 07:46 PM
I've tried tutorials everywhere but they dont do what i need.
Basically i need the textbox (ALCTextBox) to make sure that ONLY positive numbers are entered. And if they user TRIES to type a '-' it doesn't get added to the tetbox. instead a tooltip error pops up saying that they must input a positive integer.
Thank you very much for helping <3
Replies To: Tool Tips in VB
#2
Re: Tool Tips in VB
Posted 03 September 2012 - 10:44 PM
#3
Re: Tool Tips in VB
Posted 04 September 2012 - 05:57 AM
e.SuppressKeyPress = Truein the "keydown" event.
#4
Re: Tool Tips in VB
Posted 04 September 2012 - 04:22 PM
lucky3, on 03 September 2012 - 10:44 PM, said:
THAT WORKS!
However, is there an option that STOPS the user from entering a '-' or a letter of the alphabet? As in if they try and press 'w', the 'w' wont appear only the error?
#6
Re: Tool Tips in VB
Posted 05 September 2012 - 01:00 AM
_HAWK_, on 04 September 2012 - 08:25 PM, said:
Okay, i now have the opposite XD
It restricts all non-numeric inputs but has no display?! :|
Is there anyway that i can notify the user to enter positive numbers?
#7
Re: Tool Tips in VB
Posted 05 September 2012 - 01:51 AM
This post has been edited by lucky3: 05 September 2012 - 01:52 AM
#8
Re: Tool Tips in VB
Posted 05 September 2012 - 02:47 AM
However. If i enter a letter it accepts it
Heres my code:
Private Sub ALCTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ALCTextBox.KeyPress
If (e.KeyChar < "0") _
AndAlso e.KeyChar <> ControlChars.Back AndAlso e.KeyChar <> "." Then
e.Handled = True
Dim myToolTip As New ToolTip With {.IsBalloon = True, .ToolTipTitle = "Error..."}
myToolTip.Show("You must enter a positive Integer", ALCTextBox, 3000)
ElseIf IsNumeric(ALCTextBox) Then
e.Handled = True
Dim myToolTip As New ToolTip With {.IsBalloon = True, .ToolTipTitle = "Error..."}
myToolTip.Show("You must enter an Integer", ALCTextBox, 3000)
End If
End Sub
End Class
#9
Re: Tool Tips in VB
Posted 05 September 2012 - 03:45 AM
OrElse e.KeyChar > "9"
EDIT:
These few lines worked for me...
If (e.KeyChar < "0") OrElse e.KeyChar > "9" _
AndAlso e.KeyChar <> ControlChars.Back _
AndAlso e.KeyChar <> "." Then
e.Handled = True
Dim myToolTip As New ToolTip With {.IsBalloon = True, .ToolTipTitle = "Error..."}
myToolTip.Show("You must enter a positive Integer", Me.txbUsrName, 3000)
End If
This post has been edited by ebolisa: 05 September 2012 - 03:55 AM
#10
Re: Tool Tips in VB
Posted 06 September 2012 - 09:38 PM
Is there anyway that i can change the LOCATION of the pop-up bubble?
Its showing underneath the textbox and its distracting
This post has been edited by Rmclayton: 06 September 2012 - 09:44 PM
#11
Re: Tool Tips in VB
Posted 06 September 2012 - 09:58 PM
|
|

New Topic/Question
Reply



MultiQuote




|