Results 1 to 7 of 7

Thread: [2005] NumericTextbox

Threaded View

  1. #1

    Thread Starter
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    [2005] NumericTextbox

    Dear All,
    I am trying to develope a Numeric text control box as follows.But this not working properly.Can somebody help.
    VB Code:
    1. Public Class NumericTextboxControl
    2.     Inherits System.Windows.Forms.TextBox
    3.     Private _Handled As Boolean = False
    4.  
    5.     Protected Overrides Function IsInputkey(ByVal Keychar As System.Windows.Forms.Keys) As Boolean
    6.         Select Case Keychar
    7.             Case Keys.NumPad0 To Keys.NumPad9 'Allow Numberpad 0-9
    8.                 Return _Handled = True
    9.             Case Keys.Back 'Allow Backspace key
    10.                 Return _Handled = True
    11.             Case Keys.D0 To Keys.D9  'Allow Decimal 0-9
    12.                 Return _Handled = True
    13.             Case Else
    14.                 Return _Handled = False
    15.         End Select
    16.     End Function
    17.     Public Property Handled() As Boolean
    18.         Get
    19.             Return _Handled
    20.         End Get
    21.         Set(ByVal value As Boolean)
    22.             _Handled = False
    23.         End Set
    24.     End Property
    25.  
    26. End Class
    Last edited by danasegarane; Feb 17th, 2007 at 07:57 AM.
    Please mark you thread resolved using the Thread Tools as shown

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width