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 5 7658
"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
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
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
"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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Gary Brewer |
last post by:
Why did Microsoft decide to start the DateTime.DayOfWeek enumeration with
Sunday and ending on Saturday. I thought that a week began on Monday rather
than Sunday? Or is this an age old unresolved...
|
by: Gerben van Loon |
last post by:
Hi there, hope someone can help me on this:
DateTime.Now.DayOfWeek is always returning the american day names like
"Monday, Saturday". Even when my CurrentCulture is set to my localized
culture....
|
by: M |
last post by:
Hello,
I have code like
dt.DayOfWeek.ToString(CultureInfo.CurrentCulture)
where dt is a DateTime object.
I get something like "Sunday", "Monday", etc... while I'm expecting it to be
in...
|
by: simon |
last post by:
dateTime sellDate;
int16 dayOfWeek;
dayOfWeek=sellDate.DayOfWeek
I would like to set that monday is the first day of a week and not sunday.
Any idea?
In VB there is a function, where you...
|
by: Harry Haller |
last post by:
The context is shown below in the getGames() method.
I get errors on these lines:
dtGames.Rows = (TimeSpan)dtGames.Rows;
dtGames.Rows = (DayOfWeek)dtGames.Rows;
because the playDate column...
|
by: Charlie Brown |
last post by:
I am trying to cast a string to System.DayOfWeek. Don't even know if
this is possible but it would sure save me a lot of headache if it is.
Trying...
Dim strDay As String = "Wednesday"
Dim...
|
by: David P. Donahue |
last post by:
Probably a simple question:
I have a function that receives as an argument a DateTime value. One of
the things I want to do is check to see if it's a weekday. So I do the
following (sorry for...
|
by: bojan.pikl |
last post by:
Hi, I am making a calendar. It is costum made and I would like to have
the ability to choose the first day (Monday or Sunday). I know for the
firstDayOfWeek, but I can't change it. What should I do?
|
by: Brian S. |
last post by:
Hi,
I am trying to calculate the number of DayOfWeek in a month.. for instance..
this month April I want to know how many tuesdays there are in this month,
this year
I try to use
where intDOW =...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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: 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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| | |