473,320 Members | 2,133 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,320 software developers and data experts.

Get first day of the month using MonthCalendar control

gv
Hi all,

Using VB Express 2005

How do I get the day of the first day of the month using the
MonthCalendar control. so if the MonthCalendar control is
set to the systems date.
thanks
gv
Dec 21 '05 #1
3 2512
gv
This is what I came up with? any thing wrong with it?

Dim SystemDatefirstofmonth As Date
Dim FirstDayofMonthName As String
SystemDatefirstofmonth =
DateTime.Now.AddDays(-MonthCalendar1.TodayDate.Day)
FirstDayofMonthName = WeekdayName(Weekday(SystemDatefirstofmonth))

thanks
gv
"gv" <vi*****@musc.edu> wrote in message
news:ur*************@TK2MSFTNGP15.phx.gbl...
Hi all,

Using VB Express 2005

How do I get the day of the first day of the month using the
MonthCalendar control. so if the MonthCalendar control is
set to the systems date.
thanks
gv

Dec 21 '05 #2
gv
ok

I think the previous was wrong how about this?

Dim firstday As Date = MonthCalendar1.TodayDate
Dim Hdays As Day = MonthCalendar1.TodayDate.Day
firstday = firstday.AddDays(-Hdays).AddDays(1)

thanks
gv

"gv" <vi*****@musc.edu> wrote in message
news:ur*************@TK2MSFTNGP15.phx.gbl...
Hi all,

Using VB Express 2005

How do I get the day of the first day of the month using the
MonthCalendar control. so if the MonthCalendar control is
set to the systems date.
thanks
gv

Dec 21 '05 #3
Here's how I would do it

DateTime d = new DateTime(monthCalendar1.TodayDate.Year,
monthCalendar1.TodayDate.Month, 1);
string day = d.DayOfWeek.ToString();

I know it is in C# but it is the same.
Tim
"gv" wrote:
ok

I think the previous was wrong how about this?

Dim firstday As Date = MonthCalendar1.TodayDate
Dim Hdays As Day = MonthCalendar1.TodayDate.Day
firstday = firstday.AddDays(-Hdays).AddDays(1)

thanks
gv

"gv" <vi*****@musc.edu> wrote in message
news:ur*************@TK2MSFTNGP15.phx.gbl...
Hi all,

Using VB Express 2005

How do I get the day of the first day of the month using the
MonthCalendar control. so if the MonthCalendar control is
set to the systems date.
thanks
gv


Dec 22 '05 #4

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

Similar topics

0
by: Sharon | last post by:
is there any way I can make the monthcalendar control show Hebrew date's ? thank you Sharon .
1
by: Trevor | last post by:
When the year in the monthcalendar control is decremented the whole year is selected between the currently select date and the newly chosen date. However this highlighting behavior does not occur...
8
by: vbmark | last post by:
I want the MonthCalendar control to return the single day selected. I have MaxSelectionCount = 1. What I get back though is this: "SelectionRange: Start: 5/5/2005 12:00:00 AM, End: 5/5/2005...
3
by: RG | last post by:
For a Windows project in VB.NET 2003: I need a Calendar that’s much larger than the MonthCalendar control in the toolbox; it needs to fill the whole screen (at least approximately ). VB...
2
by: Al_C | last post by:
Hi, Have an app where the user wants to pull up data for selected dates. The monthcalendar control is ideal for that, but the problem I have is that there may not be data for all dates. I'd...
0
by: ramesh.nrk | last post by:
Hi, In my windows application I need to display MonthCalendar control with some selected dates. I am using the property "Bolded Dates" to add selected/some dates. But those dates are displayed in...
0
by: CharlieC | last post by:
I seem to have an issue with the MonthCalendar control. When I click on the year, to change the year, the dates not not seem to redraw properly, especially if I go back in time. All seems Ok if I...
5
by: Randy | last post by:
Based on the date that the user selects, I'm trying to make the MonthCalendar control highlight the entire week. In my case, the week is from Monday - Sunday. I thought that using AddBoldedDate...
0
by: dougancil | last post by:
I'm relatively new to using VB but I'm trying to design a small program that has a lot of SQL involved in it that someone else wrote. What I'm trying to do is to do a date selection of 7 days at a...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.