Results 1 to 4 of 4

Thread: [RESOLVED] User Controls

  1. #1
    Addicted Member
    Join Date
    Sep 08
    Location
    Reading, UK
    Posts
    159

    Resolved [RESOLVED] User Controls

    Hi There

    Im trying to create my own User Control for a Date Time Picker
    The purpose of creating my own is so that i can have a readonly text box displaying the date everytime the field is not 'Enabled'. this is my preference to swapping the visibliity of seperate text box over A normal Date time picker.

    I have called the Control simply CtlDtp

    Sadly im having problems straight off the Bat. I have set up Value Property using the code

    Code:
    public DateTime Value
            {
                get { return Dtp.Value; }
                set { Dtp.Value = Value;}
            }
    but i can't Change the Value of the property using

    Code:
    CtlDtp.Value = Convert.ToDateTme("09/08/2012")
    or even by changing the property in the property window

    there must be something that i am missing

    Maany thanks

    Ian

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 02
    Posts
    21,655

    Re: User Controls

    Are you getting an error or something? We're not sitting in your lap, so we can't see what you're seeing, so you'll need to paint a more complete picture. Syntatically I don't see anything wrong, so ....

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
    *Proof positive that searching the forums does work: View Thread *
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *
    * Use Offensive Programming, not Defensive Programming. * On Error Resume Next is error ignoring, not error handling(tm).
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN

  3. #3
    Addicted Member
    Join Date
    Sep 08
    Location
    Reading, UK
    Posts
    159

    Re: User Controls

    Hi Techgnome

    my humble apologies i cracked it moments before your post, the

    Code:
    set { Dtp.Value = Value;}
    is with an uppercase V where the actuall variable when it comes from a property is a lower case v

    this is why i wasn't getting an error and why it wasn't making any change as it was setting it with the current Value


    many thanks for your reply

    Ian

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 02
    Posts
    21,655

    Re: [RESOLVED] User Controls

    I missed it too.... yeah... C# is case sensitive... and value isn't the same as Value... glad it's all sorted.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
    *Proof positive that searching the forums does work: View Thread *
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *
    * Use Offensive Programming, not Defensive Programming. * On Error Resume Next is error ignoring, not error handling(tm).
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN

Posting Permissions

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