Results 1 to 4 of 4

Thread: Using Updown with MaskEdBox

  1. #1

    Thread Starter
    Hyperactive Member JazzBass's Avatar
    Join Date
    Jun 1999
    Posts
    393

    Using Updown with MaskEdBox

    Hi,

    I've done the same thing you would if you were going to use a textbox with an updown control, but I can't get it to work with a MaskEdBox.

    I like the idea of only being able to accept numeric values, but for whatever reason I can't seem to get the updown to work with a MaskEdbox.

    Can the two be used together?

    Thanks,
    JB
    JazzBass
    In the .NET era
    Trying to remember VB6
    Progress:
    XP Professional @ Home
    and @ the Office

  2. #2

    Thread Starter
    Hyperactive Member JazzBass's Avatar
    Join Date
    Jun 1999
    Posts
    393

    Any Help?

    Does anyone know?

    Thanks,
    JB
    JazzBass
    In the .NET era
    Trying to remember VB6
    Progress:
    XP Professional @ Home
    and @ the Office

  3. #3
    Fanatic Member
    Join Date
    Jun 2003
    Location
    IL
    Posts
    739
    I am not sure what you are talking about when you mention the up down thing, but if it works with a regular text box and not a mask edit control then you can simply filter out all characters besides numeric values in the Key_Press event for the text box.

    Example

    Private Sub txtbox_KeyPress(KeyAscii As Integer)
    Dim Char As String

    Char = Chr$(KeyAscii)

    If KeyAscii <> 8 And KeyAscii <> 13 Then

    If IsNumeric(Char) = False Then
    KeyAscii = 0
    End If
    End If

    End Sub

  4. #4

    Thread Starter
    Hyperactive Member JazzBass's Avatar
    Join Date
    Jun 1999
    Posts
    393

    Smile Thanks

    Thank you very much.

    Looks like I'll have to go that route.

    JB
    JazzBass
    In the .NET era
    Trying to remember VB6
    Progress:
    XP Professional @ Home
    and @ the Office

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