473,387 Members | 1,549 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,387 software developers and data experts.

Calendar questions

1. How do you change the font/forecolor of the Month name that shows up in
the calendar.
2. I am setting the SelectedDate property based on a dropdownlist. It is
selecting properly internally, but the calendar stays on the same month.
Any ideas?

Thanks!
Nov 19 '05 #1
3 894
Hello [it would be nice to have a person's name],

1. You can set the CSSClass for the titlestyle property and then define a
style. See the code sample.

2. Don't forget to set the VisibleDate property as shown in the code samples
below.

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim intCounter As Integer
For intCounter = 1 To 12
DropDownList1.Items.Add(intCounter.ToString)
Next
End If
End Sub
Private Sub DropDownList1_SelectedIndexChanged _
(ByVal sender As Object, ByVal e As System.EventArgs) Handles
DropDownList1.SelectedIndexChanged
Dim dtm As DateTime
dtm = Now.AddMonths(Int(DropDownList1.SelectedItem.Text) )
Calendar1.VisibleDate = dtm
Calendar1.SelectedDate = dtm
End Sub

<style>
.mytitlestyle {color:red}
</style>

<asp:dropdownlist id="DropDownList1" runat="server"
AutoPostBack="True"></asp:dropdownlist></p>
<asp:calendar id="Calendar1" runat="server">
<titlestyle cssclass="mytitlestyle"></titlestyle>
</asp:calendar>
Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]
Toronto

"VB Programmer" <Do*****************@jEmail.com> wrote in message
news:eY**************@TK2MSFTNGP10.phx.gbl...
1. How do you change the font/forecolor of the Month name that shows up
in the calendar.
2. I am setting the SelectedDate property based on a dropdownlist. It is
selecting properly internally, but the calendar stays on the same month.
Any ideas?

Thanks!


Nov 19 '05 #2
As usual your answer helps! By the way, the names Bob. :)
"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:eV****************@TK2MSFTNGP09.phx.gbl...
Hello [it would be nice to have a person's name],

1. You can set the CSSClass for the titlestyle property and then define a
style. See the code sample.

2. Don't forget to set the VisibleDate property as shown in the code
samples below.

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim intCounter As Integer
For intCounter = 1 To 12
DropDownList1.Items.Add(intCounter.ToString)
Next
End If
End Sub
Private Sub DropDownList1_SelectedIndexChanged _
(ByVal sender As Object, ByVal e As System.EventArgs) Handles
DropDownList1.SelectedIndexChanged
Dim dtm As DateTime
dtm = Now.AddMonths(Int(DropDownList1.SelectedItem.Text) )
Calendar1.VisibleDate = dtm
Calendar1.SelectedDate = dtm
End Sub

<style>
.mytitlestyle {color:red}
</style>

<asp:dropdownlist id="DropDownList1" runat="server"
AutoPostBack="True"></asp:dropdownlist></p>
<asp:calendar id="Calendar1" runat="server">
<titlestyle cssclass="mytitlestyle"></titlestyle>
</asp:calendar>
Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]
Toronto

"VB Programmer" <Do*****************@jEmail.com> wrote in message
news:eY**************@TK2MSFTNGP10.phx.gbl...
1. How do you change the font/forecolor of the Month name that shows up
in the calendar.
2. I am setting the SelectedDate property based on a dropdownlist. It
is selecting properly internally, but the calendar stays on the same
month. Any ideas?

Thanks!

Nov 19 '05 #3
Glad to help, Bob!

Ken

"VB Programmer" <Do*****************@jEmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
As usual your answer helps! By the way, the names Bob. :)


Nov 19 '05 #4

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

Similar topics

1
by: MLH | last post by:
I had an MS Access app translated into a PHP - MySQL app. The purpose of porting the app was so the app could be run by websurfers right from their browsers. Knowing nothing of PHP, I am trying...
16
by: DFS | last post by:
If you're listening, I want the middle of the calendar (showing 1 month) to open below the cursor position. It currently opens just to the right and below the cursor position. I hunted through...
3
by: | last post by:
Hi!! Did Infragistics or some other company else provide a web calendar conrol with the features and look of Microsoft Outlook calendar? I mean that feature that you can choose Day / Work Week /...
3
by: thegoodtimesarekillingme | last post by:
Hi. I'm looking to use Matt Kruse's calendar script to create a calendar that will automatically be written to a page. I don't need it to pop-up like he has it set. The test URL I have is as...
1
by: xian2 | last post by:
Hi, I wanted to create a calendar in Access that would call on data stored within tables in the database (dates in forms) and would show it visually on a calendar when the calendar was opened. I...
5
by: MOC835 | last post by:
I have calendar control that I am trying to use on a continuous subform to select two dates. My MainForm collects user data, and the continuous SubForm collects two dates for that specific...
76
by: apartain | last post by:
Has anyone ever created a shared calendar within Access? It would be similar to MS Outlook, but clearly not as in-depth. I would need to use it for employees to enter their availability so managers...
2
by: jugglegood | last post by:
I set up this calendar where people can subscribe with ical. They subscribe to a php file(instead of ics) and it dynamically loads the calendar from the database. something like this has to be done...
7
by: William (Tamarside) | last post by:
Please, if you have the time and knowledge to help me I'd truly appreciate it! I need to build a calendar page that displays available/unavailable info from a DB and colour a cell according to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...

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.