473,396 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do i use Calender control in VS 2003?

Hi there,
I have a text box in my webform to type in a date. I want to take
advantage and use the calender control to let the user just to click on

the clander and select a date. How do i program this? is there a link
with a code snippet?
Thanks
-L

Dec 21 '05 #1
3 1182
Here is a small piece of code that does what you want:

Private Sub Calendar1_SelectionChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Calendar1.SelectionChanged

TextBox1.Text = Calendar1.SelectedDate.ToShortDateString()

End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox1.TextChanged

Calendar1.SelectedDate = CDate(TextBox1.Text)

End Sub
Take note, however, that you need to have some way of doing a postback when
the TextChanged event occurs, such as a separate Button in which you can
place the code I put in the TextChanged event, or you can set the
AutoPostBack property to True. Although it is not a requirement, you may
also want to add validation to make sure the date entered in TextBox1.Text
is a valid date before attempting to assign it to Calendar1.SelectedDate.
Good Luck!
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Learner" <pr****@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi there,
I have a text box in my webform to type in a date. I want to take
advantage and use the calender control to let the user just to click on

the clander and select a date. How do i program this? is there a link
with a code snippet?
Thanks
-L

Dec 21 '05 #2
Hi Nathan,
Cool! Thanks much and appricate your time explaining this to me. I
liked it when you also consider the scenario of
TextBox!_TextChanged event. I will try implementing.
Thanks
-L

Dec 21 '05 #3
Hello

Find some javascript date picker control. That is freely available and
it will more suitable to you.

B

Dec 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: PerryC | last post by:
I want to be able to accomplish this, please help: When click on the DOB field, a ActiveX Calender popup and the user choose a date, the value is automatically refreshed in the DOB field in the...
0
by: Steve Peterson | last post by:
Hi I have a web app running on WinXP Pro which has the OS's operating system's regional settings set to "Spanish - Spain". I have a web app running on this computer that one page has a calender...
4
by: Chris | last post by:
Hi, I am trying to create a popup calender so a user can click on a button on the main form, a calender will then popup, the user will select a date and then click ok on the popup. The date will...
1
by: Jessica Weiner | last post by:
I have an ASP .NET web application and I am using the calender control to display the month view and some events that are scheduled to happen during the month. Whenever the user selects a month,...
0
by: jack | last post by:
Hi all, I this this would be the most common question to most of the professionals out there. but for me its a head ac I am developing in asp.net 2.0 and wanted to use drop down calender...
1
by: Doug | last post by:
Hi, How do I get a Calender Control popup to appear near the button which activated it, rather than on the other side of the screen? (MS Access 2000)
0
by: raghulvarma | last post by:
I am developing a web page using c# as my code behind. I need to have a java script for a calender control.I know how to use the calender control which is seen in the tool bar. But I don't need that...
1
by: sudip2008 | last post by:
When using the Calendar Popup in a content page of a masterpage the strForName is always set to aspnetForm This breaks this line from working properly window.opener.document.forms...... How can...
21
Vkas
by: Vkas | last post by:
i had created my own web calender control!!!! it consist 1} text box (it display's the selected date) 2} button (it hide and show the calender control) 3} calender control (use for the selection...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.