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

DaitTimePicker Events

Good evening. My name is Don. I tried the intrduction page but couldn't get it to accept my message.
I am developing software in VB 2005, and I am looking for quidance in using the datetimepicker control. I have code in the datechanged event to retrieve data from the database. The code works fine. The problem I have is that the code executes when I change the calendar month. I am looking for an event that executed before the datechanged event, so that I can set some kind of flag that can be queried in the datechanged event to supress the code there.
May 7 '07 #1
4 1299
Dököll
2,364 Expert 2GB
Good evening. My name is Don. I tried the intrduction page but couldn't get it to accept my message.
I am developing software in VB 2005, and I am looking for quidance in using the datetimepicker control. I have code in the datechanged event to retrieve data from the database. The code works fine. The problem I have is that the code executes when I change the calendar month. I am looking for an event that executed before the datechanged event, so that I can set some kind of flag that can be queried in the datechanged event to supress the code there.
Hello, Don!

Can you do this in form load?

You should add your code so members here can see it, the possibilities are endless beyond that.

We'll read about it and see what I can do meanwhile, Don.

In a bit!

Dököll
May 8 '07 #2
Killer42
8,435 Expert 8TB
...The problem I have is that the code executes when I change the calendar month.
Could you explain in a little more detail what you mean by this, please?

Also, have you tried playing around with the other events, to see when they are triggered? I’m using VB6 and I believe the events are a little different, but the Click event might be worth a look.
May 8 '07 #3
Hello, Don!

Can you do this in form load?

You should add your code so members here can see it, the possibilities are endless beyond that.

We'll read about it and see what I can do meanwhile, Don.

In a bit!

Dököll
I am performing the event in the form load, because the load does not trigger the DateChanged event and I want to get the data on the load. The problem is that the DateChanged event is triggered when I click the calendar to change the month. I am looking for a way to not go out to the database before the month changes. The DateChanged event is triggered Two times, once before the date changes, and one after. I do want the second occurrence of DateChanged to execute, so I can check the new date, but I want to set up a flag to stop the DateChanged event from executing before the month changes. Even if I find an event that happens before the DateChanged event, How do I identify that the Arrow has been clicked instead of a Date in the datetimepicker?
May 8 '07 #4
Dököll
2,364 Expert 2GB
I am performing the event in the form load, because the load does not trigger the DateChanged event and I want to get the data on the load. The problem is that the DateChanged event is triggered when I click the calendar to change the month. I am looking for a way to not go out to the database before the month changes. The DateChanged event is triggered Two times, once before the date changes, and one after. I do want the second occurrence of DateChanged to execute, so I can check the new date, but I want to set up a flag to stop the DateChanged event from executing before the month changes. Even if I find an event that happens before the DateChanged event, How do I identify that the Arrow has been clicked instead of a Date in the datetimepicker?
Sounds pretty fancy there, diston52...

Still, you did not add your code. I am also using VB 6, so I can only offer information and ideas. I did pull up a code on specific to DateTimePicker, sett your eyes on it, see if you can strip it for your own use. Also go to the link to truly see what it does. Bare in mind I am only a messenger, you'll need to add your code for skilled/trained eyes here to see what's a miss:

Gathered through: http://www.devage.com/Wiki/ViewArtic...grid&version=0

Go towards mid portion of the page to see this code

Expand|Select|Wrap|Line Numbers
  1.  
  2. public class DateTimePicker : EditorControlBase
  3. {
  4.     public DateTimePicker():base(typeof(System.DateTime))
  5.     {
  6.     }
  7.  
  8.     protected override Control CreateControl()
  9.     {
  10.         System.Windows.Forms.DateTimePicker l_dtPicker = new System.Windows.Forms.DateTimePicker();
  11.         l_dtPicker.Format = DateTimePickerFormat.Short;
  12.         return l_dtPicker;
  13.     }
  14.  
  15.     public new System.Windows.Forms.DateTimePicker Control
  16.     {
  17.         get{return (System.Windows.Forms.DateTimePicker)base.Control;}
  18.     }
  19.     public override void SetEditValue(object editValue)
  20.     {
  21.         if (editValue is DateTime)
  22.             Control.Value = (DateTime)editValue;
  23.         else if (editValue == null)
  24.             Control.Value = DateTime.Now;
  25.         else
  26.             throw new SourceGridException("Invalid edit value, expected DateTime");
  27.     }
  28.     public override object GetEditedValue()
  29.     {
  30.         return Control.Value;
  31.     }
  32. }
  33.  
  34.  
You will need to do a lot of work, it seems, to get what you need out of it. Keep asking questions, just in case...

Good luck!
May 9 '07 #5

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

Similar topics

5
by: Vince C. | last post by:
Hi. I'd like to trap ADO Recordset object events in my ASP script (either VBS or JS, no preference). I've tried (in VBS) writing a Sub rs_RecordChangeComplete( adReason, cRecords, pError,...
8
by: Edward Diener | last post by:
Is it possible for a derived class to override a property and/or event of its base class ?
3
by: Sasha | last post by:
Hi everyone, Here is my problem: I have the following classes: - DataNode - this class is designed to hold some data and will be contained in a tree like data structure DataTree. When...
6
by: Saso Zagoranski | last post by:
Hi! How can I unregister all the events registered to a control? I have seen a piece of code in another thread, which gets all the registered handlers for a specific event. Let's say I have a...
14
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using...
2
by: Bob Rundle | last post by:
I have the following code, which appears to be working. However it doesn't look right. The part I am wondering about is the logic in DisconnectEvents(). This logic creates a new delegate and...
4
by: LP | last post by:
Hello! I am still transitioning from VB.NET to C#. I undertand the basic concepts of Delegates, more so of Events and somewhat understand AsyncCallback methods. But I need some clarification on...
11
by: Nicky Smith | last post by:
Hello, I'm studying a book on VB.net Win apps, and I'm reading a section on events and delegates and raising events. Is it just me, or is this not just subs dressed up as something else? I...
14
by: xoozlez | last post by:
Hi there, I have a registration form where I like to filter out the past events of 2007. This is the code I am using : strSQL = "SELECT EventID, EventName, EventDateBegin, EventDateEnd,...
1
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.