472,995 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,995 software developers and data experts.

NumericUpDown Control

2
hi
I am studying vb by distance learning n i do need all the help i can get. i am to develop a program to be used as a student data base. One of the required information is an input for student Date of birth from which the program will then calculate the age of the student.
If used 3 numericUpDown Controls for this. one eacc for the day, month and year. the problem i am facing is that i cant get the dates to appear in the format
say 12/11/2007 in a label i placed underneath the numericUpDown control. what can i do about this please???????????????
Apr 29 '07 #1
3 3725
Killer42
8,435 Expert 8TB
Do you mean that you want the three values to be combined into a date, and then displayed in a single label? Or is there a separate label beneath each UpDown control?

Can you show us what you've attempted so far along these lines?
Apr 29 '07 #2
samud
2
Do you mean that you want the three values to be combined into a date, and then displayed in a single label? Or is there a separate label beneath each UpDown control?

Can you show us what you've attempted so far along these lines?

yeah! i am tryn to get the three values combined into date format in a label i named LblBirthDate.
what i have looks like this
LblBirthDate.Text = Str(nudDay.Value) + Str(nudMonth.Value) + Str(nudYear.Value)
This way i only get something lookn like this 1 11 1995 with no "/" separating the day from month and month from year.

ps bn new at this, is there any book you would recommend for a complete novice like myself. i really need to get ma act together on this.
Apr 30 '07 #3
Killer42
8,435 Expert 8TB
yeah! i am tryn to get the three values combined into date format in a label i named LblBirthDate.
what i have looks like this
LblBirthDate.Text = Str(nudDay.Value) + Str(nudMonth.Value) + Str(nudYear.Value)
This way i only get something lookn like this 1 11 1995 with no "/" separating the day from month and month from year.

ps bn new at this, is there any book you would recommend for a complete novice like myself. i really need to get ma act together on this.
When you are concatenating the three strings, you just need to include another two strings between them. That is, the slashes ("/"). In fact, I would recommend the following changes...
  • Drop the Str() functions. Pretty sure they're unnecessary. Actually, since Str() leaves a space, you might have to change to the Format() function.
  • Use & rather than + to concatenate the values into the string. The plus sign can be misinterpreted as a numeric addition. Hm... which might explain why you have the STR() functions there, I suppose.
  • Consider the possibility of replacing all this with a datepicker control. This gives you a date field, which can pop up a calendar to allow the user to select a date. Depending on the circumstances, it can be a great help to the user or a nuisance.

If you try a search for something like "VB TUTORIAL" I think we have had quite a few references to them. When I can find time, I'll try to put up a list of tutorials and things like that at the top of the VB forum. Alternatively, use something like Google to search the web for VB tutorials.
Apr 30 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: | last post by:
Hi, I am setting the NumericUpDown .Value property and the ValueChanged event is NOT being fired. Does this ONLY get fired when I change it on the UI and not programatically? Thanks
0
by: Koert | last post by:
Hi, In the NumericUpDown control I have to detect that Tab was pressed so I have overroden the PreProcessMessage function. In for example the DateTimePicker this works fine but not in the...
1
by: Tantra Veda | last post by:
Hello C# gurus, I have a question about finding cursor position in NumericUpDown control. On my form I have a numericUpDown control with 2 decimal places. I want to increment value in the numeric...
10
by: Bonj | last post by:
I'm using a number of NumericUpDown controls on my form, which controls printer settings such as number of pages. However I want to override one of the default behaviours of the control, namely...
0
by: Koert | last post by:
Hi In the NumericUpDown control I have to detect that Tab was pressed so I have inherited the NumericUpDown and overroden the PreProcessMessage function. In the DateTimePicker (for example) this...
2
by: bnob | last post by:
It is possible to format the numeric value of the NumericUpDown control For example : display numbers in 2 digits, instead of 1 display 01, 0 -> 00 , 9 -> 09 Any idea -- Ceci est une...
3
by: abc my vclass | last post by:
My win-form have many numericupdown controls to applied. But numericupdown control don't like textbox, text box control can automatic selected text when got focus. Is there any method can let me...
4
by: illegal.prime | last post by:
Hey all, I have a NumericUpDown control on a Panel or potentially a Form that have AutoScroll enabled. When the NumericUpDown is active I would like the Form/Panel/whatever not to scroll when I...
5
by: Len Weltman | last post by:
I am trying to pass a NumericUpDown object into a class method using Visual Studio 2005, but the control type is not found in Intellisense and the type declaration is flagged as an error. Here...
2
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello experts, I posted a disturbing question in here:...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.