Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8466191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:16:08+00:00 2026-06-10T15:16:08+00:00

I have a win form in C# which uses a DateTimePicker and few textboxes.

  • 0

I have a win form in C# which uses a DateTimePicker and few textboxes. The textboxes collect some information from the user specific to the date in the DateTimePicker.

I want to save the data in textboxes when the date is changed in DateTimePicker.

For that I need to read the date in DateTimePicker before the date is changed.

How could I do that? DateTimePicker_valueChanged event doesn’t seem to do this.

The value read from the dateTimePicker is the value after changing the date. How could I get the date before changing date?

Please help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T15:16:10+00:00Added an answer on June 10, 2026 at 3:16 pm

    You need to store the value in some sort of variable when you set the value.

    So if you are setting the value on load of a form, then you store it in the variable too. When the change event fires then you can use the stored variable. Once you have finished with it, you can update it to match the new changed value ready for the next time it is changed.

    For example:

    public class MyClass
    {
    
        DateTime? LastDateValue = null;
    
        void OnLoad()
        {
           //Set both datepicker and LastDateValue to be the same
        }
    
        void DateTimePicker_valueChanged()
        {
           //use LastDateValue to save text fields
           //set LastDateValue to match new value ready to use on next event fire
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a win form, on which there are several radionbuttons and labels and
In a win form application, I have an array of threads which are started
I have a c# (win form) visual studio project which i am now compiling
I have a win form, where I have a block of code which keeps
I have a web form to which I want to take a parameter from
I have a problem with winform application which uses threads to update the UI.
I have a winform form which has typical OK and Cancel buttons. The OK
I have a windows installer project which installs some software (winform, service, mce addin).
I'm building a winform app which uses datagrids, lists, textboxes which are bound to
I have some C# code which is using CSharpCodeProvider.CompileAssemblyFromSource to create an assembly in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.