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

Datetimepicker

Hey Folks

i wanted to ask about the datetimepicker.
I want a messagebox to appear as soon as the user clicks on the datetimepicker.
I have tried the valuechanged event but i want the message to appear way before this stage. I want to display it as soon as the calender is displayed or as soon as the mouse is pressed on the control.

I tried the click event but this didnt work. this is what i tried:

Private Sub dtpRoomDate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles dtpRoomDate.Click
If LViewMealBookings.Items.Count > 0 Then
MsgBox("Changing the room date will cause all your meal bookings to be lost. Do you wish to continue?", vbYesNo)
If vbYes Then
dsFullBooking.Tables("dtMealBooking").Clear()
LViewMealBookings.Items.Clear()
End If
End If

End Sub

Can anyone help me?
Nov 22 '05 #1
5 1523
Cor
Hi Avni,

Try this
\\
If MsgBox("Changing the room date will cause all your meal bookings to be
lost. Do you wish to continue?", _
MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
//

I hope this helps?

Cor
Nov 22 '05 #2
Hello Cor

Thank u for the coding. What im confused on is what event to include this code under as i want the message to appear as soon as the user clicks on the dateTimePicker (i.e, before the calender appears). I have so far put this code on the valuechanged event, but i want this message to appear before the user gets the chance to change the date
If i have to include it in this valuechanged event, how do i ensure that if the user clicks 'NO' in the messagebox the date is not actually changed and is returned to its previous date

I tried including this code in the click event for the dtp but the messagebox never seemed to appear!!?
Nov 22 '05 #3
Cor
Hi Avni,

If you want not the user to select a date, why not give him a button on the
same place as the picker, after he has clicked it, you make the button
invissible and shows the picker.

Looks to me more friendly for the user, because that he can understand.

Or do I see something wrong?

Cor
Thank u for the coding. What im confused on is what event to include this code under as i want the message to appear as soon as the user clicks on the
dateTimePicker (i.e, before the calender appears). I have so far put this
code on the valuechanged event, but i want this message to appear before the
user gets the chance to change the date. If i have to include it in this valuechanged event, how do i ensure that

if the user clicks 'NO' in the messagebox the date is not actually changed
and is returned to its previous date?

Nov 22 '05 #4
Hi Cor

Do u know how i could revert the date back to its previous value if the user selects no in my messagebox
I have decided to use the valuechanged event
If the user selects yes then i want the date value to change toi whatever the user has selected. If they select no the old date is restored. Is this possible or not a good method

Nov 22 '05 #5
Cor
Hi Avni,

I nowhere have seen how you used the text from the datapicker.

There are so many posibilities, but they all depend on your program and I
think that is to big to investigate for me.

Cor

Do u know how i could revert the date back to its previous value if the user selects no in my messagebox? I have decided to use the valuechanged event.
If the user selects yes then i want the date value to change toi whatever the user has selected. If they select no the old date is restored. Is this
possible or not a good method?

Nov 22 '05 #6

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

Similar topics

2
by: Angelina | last post by:
Hi, I have got two DateTimePicker's on my form to accept a guest arrival date and departure date.what i want to acheieve is ensure that the DateTimePicker2 (departure) is always greater than...
9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
1
by: John Smith | last post by:
Hey folks, Got some strange behavior going on here. I have a datetimepicker with showcheckbox = true; If I set Checked=true and set the Text of the datetimepicker, then then the Checked...
0
by: ROG | last post by:
Hi all with help from postings on the web, i have a dateTimePicker in one of my columns in the datagrid. However, when i move in to this column using the arrow keys, it automatically pops up,...
0
by: Sumit | last post by:
Hi all, I have a datetimepicker on my windows form. When the user selects it i check whether the date entered is a Sunday or not & if its not a sunday i want that the control remains on the...
4
by: Jacek Jurkowski | last post by:
.... the minimum date of DateTimePicker is 1753-01-01. How to make DateTime to do not show nothing in its text if this date is the value? I have a form with a field LastLogonDate. If user hasn't...
7
by: Clamara | last post by:
When adding a new record from my form, I pre-set my DateTimePicker's value to System.DateTime.Today Since the "Today" value is used most of the time, the user doesn't need to select a date from...
3
by: Charlie | last post by:
In the top portion of the DateTimePicker, where the value of the date is displayed, how can I detect whether the month or day or year is currently focused, or, if ShowCheckBox = True, whether the...
3
by: Simon Tamman | last post by:
I've come across an interesting bug. I have workarounds but i'd like to know the root of the problem. I've stripped it down into a short file and hope someone might have an idea about what's going...
4
by: jehugaleahsa | last post by:
Hello: We were hoping to allow users to have DateTimePicker value null so that a unused date is stored on a Database. Does the control support this? I am pretty sure it doesn't. How would you...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.