Results 1 to 4 of 4

Thread: [RESOLVED] User Controls

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Location
    Reading, UK
    Posts
    192

    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 2002
    Posts
    34,687

    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 don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * 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??? *

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Location
    Reading, UK
    Posts
    192

    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 2002
    Posts
    34,687

    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 don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * 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??? *

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