Results 1 to 5 of 5

Thread: Custom DateTimePicker Control

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    11

    Custom DateTimePicker Control

    Hello there!

    I would like to develop a customized datetimepicker. I have a button and a datetimepicker. What I would like to happen is this: When I click on the button, it would trigger the action that drops down the calendar on the datetimepicker that I have. and if possible, display it on a location near or with respect to my button coz my datetimepicker is invisible.... any ideas and help would be much appreciated.


    Thanks!
    Last edited by cocoy; Feb 1st, 2005 at 11:26 AM.

  2. #2
    Junior Member
    Join Date
    Feb 2005
    Posts
    17

    Thumbs up Re: Custom DateTimePicker Control

    Cocoy,

    So you are looking for a calender menu from which you can choose the date and possibly put that selected date in your invisible text box? If that is right then let me know because I have a code that can be useful for this. it is in vb.net

    vikram

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Custom DateTimePicker Control

    Just place a dtp on your form set visibility to false and show it upon the button click or have the button
    completely covering the dtp. The place your button over the dtp. When you click the button you raise the
    dtp dropdown event and it wll dropdown. Or send the message to dropdown
    the dtp upon button click.
    If you position the dtp so the botton/left of it is at the bottom/left of your
    button it will appear the your
    button is dropping a calendar.

    HTH
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    Junior Member
    Join Date
    Feb 2005
    Posts
    17

    Re: Custom DateTimePicker Control

    Hey thats a good solution, although i have not used it in my dtp. But never the less i know a better way now

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Custom DateTimePicker Control

    I did a similar thing with the dtp in vb6 so thats how I remembered.

    Although for ease of use, you could create a usercontrol that inherited the dtp and command button. Then do
    your code in there. Then you will have a scallable user control that will be easier to replicate on other
    forms/projects.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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