By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,702 Members | 1,432 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,702 IT Pros & Developers. It's quick & easy.

Syntax of DayofWeek, FirstDayofWeek ?

P: n/a
Have a group of dynamically created text boxes in a calendar like grid. At
the head of each column, the textbox is to contain the day of the week.
Now I am using a Select Case statement to determine the day.
(Yes, this is a homework assignment-it will do fine using the Select Case
statement, but it seems that it would contain less code this alternative
way)

Col & Row are integers.

If Row = 0
Select Case Col
Case 1 = "Monday"
and so on...

What would the syntax of the statements be to set the first day of the week
to Monday using the FirstDayofWeek statement, and then getting a return of
the string day value from the Col number using the DayofWeek statement.
Nothing I've tried seems to work, and I haven't been able to find any code
samples anywhere to help me.
Thanks in advance - Sean
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"What-a-Tool" <Fr***********************@cox.net> schrieb
Have a group of dynamically created text boxes in a calendar like
grid. At the head of each column, the textbox is to contain the day
of the week. Now I am using a Select Case statement to determine the
day. (Yes, this is a homework assignment-it will do fine using the
Select Case statement, but it seems that it would contain less code
this alternative way)

Col & Row are integers.

If Row = 0
Select Case Col
Case 1 = "Monday"
and so on...

What would the syntax of the statements be to set the first day of
the week to Monday using the FirstDayofWeek statement, and then
getting a return of the string day value from the Col number using
the DayofWeek statement. Nothing I've tried seems to work, and I
haven't been able to find any code samples anywhere to help me.
Thanks in advance - Sean


I'm not sure if this is what you are looking for:

Microsoft.VisualBasic.DateAndTime.WeekdayName

Call: WeekdayName(1) ... WeekdayName(7) (see docs)
Or: WeekdayName(1, False, FirstDayOfWeek.Monday)
The last parameter is FirstDayOfWeek.System by default. This should work.
Nevertheless, if it doesn't (whyever) explicitly pass the
first-day-of-the-week as the 3rd parameter.

Note: You must _not_ use members of the Enum System.DayOfWeek as the _first_
parameter for WeekdayName.
Concerning DateTime.DayOfWeek: Example: Date.Now.DayOfWeek.ToString =>
"Sunday". Right, today is Sunday. ;-)

--
Armin

Nov 20 '05 #2

P: n/a
That was exactly what I wanted - Thank you, thank you, thank you!
This is what I used (to late for my homework, but I still wanted to know!)

'Set Text into column headers(Columns and Rows start with zero)

If Row = 0 Then

txtNew.Text = WeekdayName(Col + 1, False, FirstDayOfWeek.Monday)

End If

Thanks - Sean

"Armin Zingler" <az*******@freenet.de> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"What-a-Tool" <Fr***********************@cox.net> schrieb
Have a group of dynamically created text boxes in a calendar like
grid. At the head of each column, the textbox is to contain the day
of the week. Now I am using a Select Case statement to determine the
day. (Yes, this is a homework assignment-it will do fine using the
Select Case statement, but it seems that it would contain less code
this alternative way)

Col & Row are integers.

If Row = 0
Select Case Col
Case 1 = "Monday"
and so on...

What would the syntax of the statements be to set the first day of
the week to Monday using the FirstDayofWeek statement, and then
getting a return of the string day value from the Col number using
the DayofWeek statement. Nothing I've tried seems to work, and I
haven't been able to find any code samples anywhere to help me.
Thanks in advance - Sean
I'm not sure if this is what you are looking for:

Microsoft.VisualBasic.DateAndTime.WeekdayName

Call: WeekdayName(1) ... WeekdayName(7) (see docs)
Or: WeekdayName(1, False, FirstDayOfWeek.Monday)
The last parameter is FirstDayOfWeek.System by default. This should work.
Nevertheless, if it doesn't (whyever) explicitly pass the
first-day-of-the-week as the 3rd parameter.

Note: You must _not_ use members of the Enum System.DayOfWeek as the

_first_ parameter for WeekdayName.
Concerning DateTime.DayOfWeek: Example: Date.Now.DayOfWeek.ToString =>
"Sunday". Right, today is Sunday. ;-)

--
Armin

Nov 20 '05 #3

P: n/a
WeekdayName(1, False, FirstDayOfWeek.Monday)

What's the "false" property set?
Tells it that the default first day of week is not Sunday?

"Armin Zingler" <az*******@freenet.de> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"What-a-Tool" <Fr***********************@cox.net> schrieb
Have a group of dynamically created text boxes in a calendar like
grid. At the head of each column, the textbox is to contain the day
of the week. Now I am using a Select Case statement to determine the
day. (Yes, this is a homework assignment-it will do fine using the
Select Case statement, but it seems that it would contain less code
this alternative way)

Col & Row are integers.

If Row = 0
Select Case Col
Case 1 = "Monday"
and so on...

What would the syntax of the statements be to set the first day of
the week to Monday using the FirstDayofWeek statement, and then
getting a return of the string day value from the Col number using
the DayofWeek statement. Nothing I've tried seems to work, and I
haven't been able to find any code samples anywhere to help me.
Thanks in advance - Sean
I'm not sure if this is what you are looking for:

Microsoft.VisualBasic.DateAndTime.WeekdayName

Call: WeekdayName(1) ... WeekdayName(7) (see docs)
Or: WeekdayName(1, False, FirstDayOfWeek.Monday)
The last parameter is FirstDayOfWeek.System by default. This should work.
Nevertheless, if it doesn't (whyever) explicitly pass the
first-day-of-the-week as the 3rd parameter.

Note: You must _not_ use members of the Enum System.DayOfWeek as the

_first_ parameter for WeekdayName.
Concerning DateTime.DayOfWeek: Example: Date.Now.DayOfWeek.ToString =>
"Sunday". Right, today is Sunday. ;-)

--
Armin

Nov 20 '05 #4

P: n/a
"What-a-Tool" <Fr***********************@cox.net> schrieb
WeekdayName(1, False, FirstDayOfWeek.Monday)

What's the "false" property set?
Tells it that the default first day of week is not Sunday?


Do you use Notepad for programming?
--
Armin

Nov 20 '05 #5

P: n/a
No - sorry - stupid of me. Forgot about the "intellisense" feature before I
asked the question. Just copied and pasted your "WeekdayName(1, False,
FirstDayOfWeek.Monday)" into my program, so it didn't come up till I went
back and typed it in manually.
Thanks again

"Armin Zingler" <az*******@freenet.de> wrote in message
news:uB**************@TK2MSFTNGP09.phx.gbl...
"What-a-Tool" <Fr***********************@cox.net> schrieb
WeekdayName(1, False, FirstDayOfWeek.Monday)

What's the "false" property set?
Tells it that the default first day of week is not Sunday?


Do you use Notepad for programming?
--
Armin

Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.