Click here to Skip to main content
15,905,010 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
I want create calendar which show month wise.
And having Different buttons on Form.
When user will click on button then on selected date appropriate text related to button should display below that date.
How to do this.
Pls help me for implementation.

this I want to implement on Windows form of C#.net.
Thanks in advance.
Posted
Comments
Sergey Alexandrovich Kryukov 2-Oct-12 13:53pm    
What's the problem? Tried anything?
--SA
Al Hizbul 2-Oct-12 17:01pm    
Do u want to display text from database according to selected date from calender?

1 solution

C#
Label someLabel = //...
Button timeButton = //...

//...

timeButton.Click += (sender, eventArgs) => {
    System.DateTime now = System.DateTime.Now;
    someLabel.Text = now.ToString(/* appropriate format specifier */);
};


The format specifier will help you to present date along, in appropriate order, in appropriate culture, etc. You can use additional parameters to pass culture, format, or both.
Please see:
http://msdn.microsoft.com/en-us/library/system.datetime.aspx[^],
http://msdn.microsoft.com/en-us/library/k494fzbf.aspx[^],
http://msdn.microsoft.com/en-us/library/ht77y576.aspx[^],
http://msdn.microsoft.com/en-us/library/zdtaw1bw.aspx[^],
http://msdn.microsoft.com/en-us/library/8tfzyc64.aspx[^].

For IFormatProvider parameters, you can use CultureInfo (please see the code samples in the articles references above).
All format specifiers are classified into "standard" and "custom":
http://msdn.microsoft.com/en-us/library/az4se3k1.aspx[^],
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx[^].

That's all you need.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900