Display date in textbox from messagebox

Anonymous
2023-04-22T23:29:13.6666667+00:00

Good day, I have some condition in my code but I don't know what condition I declare. Please help to solve my problem. User's image

Base to the image at the top, I create a calendar that little white square and a green box is a UserControl. Now if I click the UserControl it shown like this, Please take a look the image below. User's image

It's show message box contend of Date and time when every I click the UserControl. Now I want is If I click OK the message of messagebox it shown in Date textbox. User's image

I have a code when I click button OK, but I don't know what is the best condition of this. Here's my code. User's image

Please need help to fix this problem.

Developer technologies C++
Developer technologies C#
{count} votes

Accepted answer
  1. Minxin Yu 13,501 Reputation points Microsoft External Staff
    2023-04-24T07:54:13.62+00:00

    Hi, @Anonymous

    the message box message copy and paste into date textbox sir

    Check the textbox name in control properties and snippet below works for me:
    User's image

     if(result==DialogResult.OK) { textBox1.Text = message; }
    

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.