473,395 Members | 1,974 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,395 software developers and data experts.

VB.Net control that will let you select just a month?

Is there a control that I can put on a Form that would let a user
select just the month value? I tried to find a way to make the
DateTimePicker or the Month Calendar do what I want but I can't. I
want a way for the user to say "Let me see what is in the database
for the month of January 2004." I don't want to have it specified as
January 1 through January 31. I can do that in code behind it. I
could use a combo, and just enter

January 2004
February 2004
March 2004
etc.

That would be perfectly satisfactory. For this customer, there is no
need to go back to the past. But unless I put 10 years worth of
months in the combo, there's a problem, as you can see.

Are there custom controls out there for sale? There must be
something, but this is new to me and I don't know where to look.

Thanks

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 20 '05 #1
8 9946
Why don't you make a control that has both the month and the year as
dropdowns or spinners. Then, you could use it to select a month and then a
year. Then, you just need to add the months to the first dropdown or
spinner, and dynamically build the list of years into the second dropdown or
spinner.

Just an idea.

"felecha" <fe*******@yahoo-dot-com.no-spam.invalid> wrote in message
news:40**********@127.0.0.1...
Is there a control that I can put on a Form that would let a user
select just the month value? I tried to find a way to make the
DateTimePicker or the Month Calendar do what I want but I can't. I
want a way for the user to say "Let me see what is in the database
for the month of January 2004." I don't want to have it specified as
January 1 through January 31. I can do that in code behind it. I
could use a combo, and just enter

January 2004
February 2004
March 2004
etc.

That would be perfectly satisfactory. For this customer, there is no
need to go back to the past. But unless I put 10 years worth of
months in the combo, there's a problem, as you can see.

Are there custom controls out there for sale? There must be
something, but this is new to me and I don't know where to look.

Thanks

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---
Nov 20 '05 #2
You can do this with the DateTimePicker by Setting the CustomFormat to "MMMM
yyyy" and setting the Format to "Custom".

When you retrieve the value from the DTP by using its "Value" property, make
sure you parse the value so you only use the month and year as the DTP has a
habit of keeping the full precision date behind the scenes.

HTH,

Trev.

"felecha" <fe*******@yahoo-dot-com.no-spam.invalid> wrote in message
news:40**********@127.0.0.1...
Is there a control that I can put on a Form that would let a user
select just the month value? I tried to find a way to make the
DateTimePicker or the Month Calendar do what I want but I can't. I
want a way for the user to say "Let me see what is in the database
for the month of January 2004." I don't want to have it specified as
January 1 through January 31. I can do that in code behind it. I
could use a combo, and just enter

January 2004
February 2004
March 2004
etc.

That would be perfectly satisfactory. For this customer, there is no
need to go back to the past. But unless I put 10 years worth of
months in the combo, there's a problem, as you can see.

Are there custom controls out there for sale? There must be
something, but this is new to me and I don't know where to look.

Thanks

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---
Nov 20 '05 #3
In addition, set the "ShowUpDown" property to true to disble the drop down
calendar.

HTH,

Trev.
Nov 20 '05 #4
* fe*******@yahoo-dot-com.no-spam.invalid (felecha) scripsit:
Is there a control that I can put on a Form that would let a user
select just the month value? I tried to find a way to make the
DateTimePicker or the Month Calendar do what I want but I can't. I
want a way for the user to say "Let me see what is in the database
for the month of January 2004." I don't want to have it specified as
January 1 through January 31. I can do that in code behind it. I
could use a combo, and just enter


Why not use DateTimePicker + a custom date format ('CustomFormat' and
'Format' property)?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
I had to have a date control that allowed blank dates. So far, I haven't
come across a way to blank out the DateTimePicker. So, I've written my own
set of blank date controls.

If there is a good way to blank out the DTP though, I'd love to know it. :)
And using that checkbox isn't a good way to handle this.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bv************@ID-208219.news.uni-berlin.de...
* fe*******@yahoo-dot-com.no-spam.invalid (felecha) scripsit:
Is there a control that I can put on a Form that would let a user
select just the month value? I tried to find a way to make the
DateTimePicker or the Month Calendar do what I want but I can't. I
want a way for the user to say "Let me see what is in the database
for the month of January 2004." I don't want to have it specified as
January 1 through January 31. I can do that in code behind it. I
could use a combo, and just enter


Why not use DateTimePicker + a custom date format ('CustomFormat' and
'Format' property)?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #6
* "Scott Kilbourn" <skilbourn@NO_SPAM_PLEASE.appliedsystems.com> scripsit:
I had to have a date control that allowed blank dates. So far, I haven't
come across a way to blank out the DateTimePicker. So, I've written my own
set of blank date controls.

If there is a good way to blank out the DTP though, I'd love to know it. :)
And using that checkbox isn't a good way to handle this.


Why not? It's the preferred way, even Outlook Express handles it that way.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
Woo - some good ideas. Thanks. I'm new to a lot of stuff, didn't
know you could build your own control. never tried a spinner
before.

Can't wait to get to work

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 20 '05 #8
-----Original Message-----
Is there a control that I can put on a Form that would let a userselect just the month value? I tried to find a way to make theDateTimePicker or the Month Calendar do what I want but I can't. Iwant a way for the user to say "Let me see what is in the databasefor the month of January 2004." I don't want to have it specified asJanuary 1 through January 31. I can do that in code behind it. Icould use a combo, and just enter

January 2004
February 2004
March 2004
etc.

That would be perfectly satisfactory. For this customer, there is noneed to go back to the past. But unless I put 10 years worth ofmonths in the combo, there's a problem, as you can see.

Are there custom controls out there for sale? There must besomething, but this is new to me and I don't know where to look.
Thanks

----== Posted via Newsfeed.Com - Unlimited-Uncensored- Secure Usenet News==----http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---.
hello there

what you need to do is first in the database : if you are
using a view then add a column to this view : if the date
field is for example xx_date then define the new column
in the view as DATENAME(month,date) which returns the
month name (january, february, etc); it is a function in
sqlserver (Transact_sql).
on your form creat a text box for the year to be entered
and a combo box containing the names of the 12 months
namely january, february, march, ...december).
adjust the select statement in your oleadapter to have ?
for the column created above. then upon entry of the year
and month you can use the year entered as the first
parameter and the month name as the second parameter !!
as follows:

myadapter.SelectCommand.Parameters(0).Value = year
(entered)
myadapter.SelectCommand.Parameters(1).Value = month *from
combo box)

you can do the same by using the month no. instead of
name if you want to but in this case the function
returning the month no. from the date will be MONTH
(xx_date) which returns 1 for jan, 2 for feb ..etc. and
you can have both values selected by entering in regular
text boxes.
if you need more help contact me be e-mail
Nov 20 '05 #9

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

Similar topics

5
by: . | last post by:
Hi All ! Is it possible to get rid of these dash symbols which are underlining the column name when recordset is returned after query execution ? For example, using isql.exe: SELECT 'blah'...
5
by: keith | last post by:
This may seem simple, but I'm having a bit of trouble figuring out exactly how to do it. I'm accessing a database through an ODBC link, and I have a query that returns only jobs completed that day...
2
by: bb | last post by:
any way to prevent displaying the previous and next months in the calendar control? i have tried just blanking the text out in the dayrender IsOtherMonth and also dynamically changing the...
7
by: Sakharam Phapale | last post by:
Hi All, I want to give option to user for selecting directory, just like for selecting file using OpenFileDialog control. How to make it possible?
5
by: chad | last post by:
Hi, Im new to C#, and I have a question. I can't figure out how to set the listbox control top select multiple items in a ListBox. I have tried using the following code, but C# VS 2005 PE...
0
by: tony | last post by:
Hello! For some month ago I created a project using template Window Control Library. From this template I created a user control(DLL) that I have in the toolbox and can drag it into a window...
10
by: YvesDM | last post by:
Hi, How can I do this, I've got a little form with a dropdown. <select name="maand"> <option value='1'>januari</option> <option value='2'>februari</option> <option value='3'>maart</option>...
2
by: =?Utf-8?B?Sm9lIFRhdmFyZXM=?= | last post by:
I am using the DateTime.Parse method to parse user entered dates. The dates can be just the year, Month-year and Month-day-year in a variety of formats in a variety of cultures. I immediately parse...
1
by: Brent White | last post by:
I can't figure out what I'm doing differently with this one drop-down list control from the other two that are working just fine. Background: I am constructing a page that will allow a user to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
1
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...
0
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...
0
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,...
0
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...
0
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...
0
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,...

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.