CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    4

    Date/Time Picker

    VC++6.0 / IE5.0

    How do I control the checkbox at runtime ?
    Is it possible to initialize the date/time string to an empty string ?

    TIA


  2. #2
    Join Date
    Jun 1999
    Posts
    3

    Re: Date/Time Picker

    As far as in know you can not initialize to an empty string.

    Here is some code to turn on or off the checkbox at run time.
    Warning!
    Because of the way this work it will rearrage the tab order of you dialog.
    I have not found a way around this. If anybody knows a way let me know.


    void derived_datepicker_class::ShowNone(BOOL bShow)
    {
    CRect rc; // the current position of the control
    long lStyle; // the control stryle
    CWnd *pParent; // the parent of the control
    UINT uID; // the resource id of the control

    uID = GetDlgCtrlID();
    pParent = GetParent();

    GetWindowRect(rc);
    lStyle = ::GetWindowLong(m_hWnd, GWL_STYLE);

    if(bShow)
    lStyle |= DTS_SHOWNONE;
    else
    lStyle &= ~DTS_SHOWNONE;

    DestroyWindow();
    pParent->ScreenToClient(rc);

    Create(lStyle,rc,pParent,uID);
    }




    This function is made to work in a derived class from the date time picker control. You will need to modify, if you need it else where


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

Featured