473,795 Members | 3,323 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2541
gv
This is what I came up with? any thing wrong with it?

Dim SystemDatefirst ofmonth As Date
Dim FirstDayofMonth Name As String
SystemDatefirst ofmonth =
DateTime.Now.Ad dDays(-MonthCalendar1. TodayDate.Day)
FirstDayofMonth Name = WeekdayName(Wee kday(SystemDate firstofmonth))

thanks
gv
"gv" <vi*****@musc.e du> wrote in message
news:ur******** *****@TK2MSFTNG P15.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.AddDay s(-Hdays).AddDays( 1)

thanks
gv

"gv" <vi*****@musc.e du> wrote in message
news:ur******** *****@TK2MSFTNG P15.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(monthC alendar1.TodayD ate.Year,
monthCalendar1. TodayDate.Month , 1);
string day = d.DayOfWeek.ToS tring();

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.AddDay s(-Hdays).AddDays( 1)

thanks
gv

"gv" <vi*****@musc.e du> wrote in message
news:ur******** *****@TK2MSFTNG P15.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
1400
by: Sharon | last post by:
is there any way I can make the monthcalendar control show Hebrew date's ? thank you Sharon .
1
2620
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 if the year is incremented. Is this by design? Is there anyway to override this behavior?
8
2620
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 12:00:00 AM" How do I get the single day date?
3
11009
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 won’t allow me to change the Size Height or Width Properties. I see that you can size a Calendar control in a Web project all you like; but I’m creating a Windows application project here. I see that Size comes from System.Drawing.Size...
2
1354
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 rather not have them select dates for which there is no data. Given my choice I'd like to highlight in some fashion dates for which data is available. I can see how to use the bold attribute for a date, but it's pretty sad. I'd rther underline or...
0
2043
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 "BOLD". But I need to display with different background color. How can I display the "Bolded Dates" in different Background color?
0
1491
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 use the Month navigation buttons. It seems to be ok if I go foward in time. Microsoft Visual Studio 2005 Version 8.0.50727.762 (SP.050727-7600) Microsoft .NET Framework Version 2.0.50727
5
8733
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 along with selectionrange.start and .end would accomplish this, but it doesn't. Here is my code: Private Sub MonthCalendar1_DateChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles
0
836
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 time, and pass that as a variable to another form for processing. I've never used the MonthCalendar control before and was wondering what would be the best method for getting the date and passing that as a variable to another form that will depend on...
0
9672
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10435
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9037
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.