Results 1 to 4 of 4

Thread: Resusable Date Control

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2002
    Location
    Newcastle, Australia
    Posts
    42

    Resusable Date Control

    Hi,

    An application installed in my company requires a lot of date entry. To assist users, the date text boxes have a "mask?" of " / / " to allow the entry of European dd/mm/yyyy dates (and to re-inforece that the text box only accepts dates).

    When the textbox has the focus the following mask appears "__/__/___". The textbox only allows entry of numbers.

    When the control loses focus, the date is verified, or message box prompts the user to enter a correct date and returns the focus to the control.

    The control also allows the UP and DOWN buttons to be pressed to add or subtract a day from the control. if the control is empty, it has inserted the current date.

    I wish to implement this functionality on a project I am working on in VB.Net. I suppose this is easy enough, but I would like to know how to make the above REUSEABLE so it does not have to be re-coded for each date field within a project.

    I am quite a beginner in VB.Net and don't know muh of the correct/best way to do things, AND the correct Terminology to use/ask questions.

    Can someone provide some instrution/help on this matter?

    I am suprised to find these sorts of things do not come standard.

    Thanks!!!,

  2. #2
    Addicted Member Dmyze's Avatar
    Join Date
    Mar 2002
    Location
    Seattle
    Posts
    160
    I haven’t done this yet, but I'm pretty sure what you want is to create a custom control, and then you can just drop it on any page you need it.

    http://docs.aspng.com/quickstart/asp...authoring.aspx
    -Daryl
    "Two More Rolls of Duct tape, and the world is mine!"
    VB.NET Guru

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Make a class.
    Inherit the TextBox control.
    Code it to do what you need.
    Use the class when needed
    Profit
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  4. #4

    Thread Starter
    Member
    Join Date
    Dec 2002
    Location
    Newcastle, Australia
    Posts
    42
    Hmm,

    Thats the problem.. I don't know how do to that kind of stuff, although I am very interested to learn.

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