Results 1 to 9 of 9

Thread: [RESOLVED] [VB6] - how mask the textbox?

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,904

    Resolved [RESOLVED] [VB6] - how mask the textbox?

    i'm doing a database program with VB6. but seems that i can't use the MaskEditBox control
    so i'm using the TextBox control. my question is: how can i mask it correctly?
    heres my actual code:
    Code:
    Private Sub txtMatricula_Change()
        If Len(txtMatricula.Text) = 2 Then txtMatricula.SelText = "-"
        If Len(txtMatricula.Text) = 5 Then txtMatricula.SelText = "-"
    End Sub
    ('matricula' it's the car registration\ID)
    these code works, but it's bad when i edit it
    can anyone advice me, please?
    VB6 2D Sprite control

    To live is difficult, but we do it.

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: [VB6] - how mask the textbox?

    Why can't you use the maskedit control?

    Aside from that you could possibly put code in the lost focus event rather than the change event to format the string the way you want or use more than one text box

  3. #3

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,904

    Re: [VB6] - how mask the textbox?

    Quote Originally Posted by DataMiser View Post
    Why can't you use the maskedit control?
    seems to be ignored(except the 1st time), and i getted 1 error in IDE
    VB6 2D Sprite control

    To live is difficult, but we do it.

  4. #4
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: [VB6] - how mask the textbox?

    Quote Originally Posted by joaquim View Post
    seems to be ignored(except the 1st time), and i getted 1 error in IDE
    What do you mean by ignored?
    What error?

  5. #5

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,904

    Re: [VB6] - how mask the textbox?

    Quote Originally Posted by DataMiser View Post
    What do you mean by ignored?
    What error?
    when i 'scrool' the record, the maskedit control isn't updated
    seems that i can't use the 'custom' property, it's a class regist error. i think i can resolve these problem uninstall the VS2010(i give up on it) and then i can reinstall the VB6
    but going bacck to the problem: why the control isn't updated?
    VB6 2D Sprite control

    To live is difficult, but we do it.

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [VB6] - how mask the textbox?

    Better to fix it than to try to code up an alternative. This may be a sign that a lot more is wrong with your VB6 installation as well.

  7. #7

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,904

    Re: [VB6] - how mask the textbox?

    Quote Originally Posted by dilettante View Post
    Better to fix it than to try to code up an alternative. This may be a sign that a lot more is wrong with your VB6 installation as well.
    now i can click on 'custom' property(i reinstall it)
    but the control continues not be updated
    VB6 2D Sprite control

    To live is difficult, but we do it.

  8. #8

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,904

    Re: [VB6] - how mask the textbox?

    i'm doing more tests and i found the problem is bettween the connection of mask control and data.
    i will trying fix it
    VB6 2D Sprite control

    To live is difficult, but we do it.

  9. #9

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,904

    Re: [VB6] - how mask the textbox?

    i resolve it in diferent way: http://www.freevbcode.com/ShowCode.asp?ID=2299
    these link have 1 excelent MaskEdit control... very nice
    VB6 2D Sprite control

    To live is difficult, but we do it.

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