[quoted text, click to view] "What-a-Tool" <FrigginSpammersDieDieDie!@cox.net> wrote in message
news:rN4bb.341$0Z5.68@lakeread03...
> 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
>
FirstDayOfWeek is a property of the MonthCalendar control, not something you
can use with your grid of textboxes. There is also the FirstDayOfWeek
enumeration that specifies the valid values for the DayOfWeek arguments, as
well as the possible return values from VB intrinsic date functions. This
enum (per the help) is designed to be used with the calendar controls to
declare the first day of the week for display purposes.
Unless you write a class definition to define your "custom calendar" and
include a property for the first day of the week and set/get methods to deal
with it, FirstDayOfWeek won't be available unless you use an instance of the
MonthCalendar in your project. Then, it is available only to be used with
the MonthCalendar control.
To make it available in your project outside an existing class, you'd have
to define it.
--
Peter - [MVP - Academic]