Results 1 to 4 of 4

Thread: Masked Edit Control

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    217
    The users of my app are going to be entering dates, and I want the Masked edit control to already have the " / / " in it, so the user doesn't have to type it. I've never used the control before, I've tried setting the Mask, and it put the " / / " inside of it, except it wouldn't allow the user to type any data into it. Any suggestions, thanks

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    Private Sub Form_Load()
        MaskEdBox1.Mask = "####/##/##"  
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    217
    thanks HeSaidJoe, what is wrong with this code, it wont let me do this:

    Dim ctr as control

    For each ctr in controls
    If TypeOF ctr is MaskEDBox then
    'Do something
    end if
    Next ctr

    I have about ten mask edit controls, so I wanted to simplify it by using this code, but its not working?? Any suggestions

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'Clear all MaskEdit Boxes on Form
    
    Public Sub ClearAllMskEdits()
    
    	For intIncrement = 0 To Forms.Count - 1
            	For Each ctlMyControl In Forms(intIncrement).Controls
    '
       	If TypeOf ctlMyControl Is MaskEdBox Then
    '
                ctlMyControl.Mask = ""
                ctlMyControl.Text = ""
    'Here you need to reset the mask to whatever it was
    'example
    	   ctlMyControl.Mask = "###.00"         
    '
       End If
    '
            Next ctlMyControl
    '
                Next intIncrement
    '
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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