473,395 Members | 1,968 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.

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 1522
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.