473,569 Members | 2,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

custom datetimepicker control becomes disabled

Hello,
I'm using a custom control called datetimeslicker which inherits from the datetimepicker contro
and it allows you to bind null values to datetimepickers , the code for this is attached

However I'm binding such a control (dtsFixedDate) to a class property Fixeddat

The binding is performed as follow

Public Sub BindDateTimeSli ckerField(ByVal strBoundfield As String, ByRef MyBoundSource As Object, ByVal strBoundTo As String, ByRef MyDateControl As datetimeslicker

MyDateControl.D ataBindings.Cle ar(

Dim MyBinding As Binding = New Binding("text", MyBoundSource, strBoundTo
MyDateControl.D ataBindings.Add (MyBinding
End Su

ps myboundsource is a class and strboundto is the member of the clas

When the binding is changed I change the value of the show checkbox and checked fields depending on whethe
the bound field is null or not as shown below

Private Sub SetDateTimeSlic kerCheckBox(ByV al StrSourceDate As String, ByRef MyDateTimeSlick er As Umbrae.Windows. Forms.DateTimeS licker

If IsDBNull(StrSou rceDate) Or StrSourceDate = "" The
MyDateTimeSlick er.Checked = Fals
MyDateTimeSlick er.ShowCheckBox = Tru
Els
MyDateTimeSlick er.Checked = Tru
MyDateTimeSlick er.ShowCheckBox = Tru
End I

End Su

MY PROBLEM IS THAT WHEN i UNCHECK THE CONTROL WHICH IS BOUND TO A NULL VALUE IT WILL NOT LET ME RE-CHECK IT AND ENTER ANY DATES
any idea what is going on here, any help would be greatly appreciated

the source of the control can be found on the page below

http://www.codeproject.com/cs/miscct...7Cpicker%7Cnul

David

Nov 20 '05 #1
0 1095

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

Similar topics

5
2181
by: Jason Butera | last post by:
I know that I can read/write custom properties of an object by using the following: Setting: document.all.customProp = "this"; Getting: document.all.customProp; Is there a way I can run code when this custom property is set. Or perhaps there is a way to create a custom method?
9
3943
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 will not set the value of the control and will leave the checked status of the checkbox to false when a user selects a new date. this works fine...
4
5656
by: | last post by:
Please, help. I created my contol, ButtonX, which subclasses System.Forms.Windows.Button class. I am doing my own paiting, by overriding OnPaint and OnPaintBackground (without calling base class's OnPaint & OnPaintBackground). My button has a shape of rectangle with rounded corners and is filled with gradient brush, where user specifies the...
0
843
by: Reny J Joseph Thuthikattu | last post by:
I was trying to use a Custom control in my ASP.NET web page(a datetimepicker) with the help of url http://aspnet.4guysfromrolla.com/articles/052604-1.aspx. I made it.But i want to get the value from the datetimepicker object when the user submit the page. I have used <OBJECT id="MyWinControl1" height="200" width="200"...
1
9394
by: Rich | last post by:
Hello, I have some datefields in a dataset (ds1). I bind some textbox controls on a windows form to these date fields in ds1, but I only want to see 01/01/2004 instead of 1/1/2004 8:00:00 AM. In a DateTimePicker control I can set a custom format("MM/dd/yyyy"). So when I iterate through ds1 with currency manager (cma) I see the correct...
0
1898
by: Brian Henry | last post by:
Ok I've never implemented a snap location before so I dont really know what im doing wrong here... anyways, I am making a custom slider control that takes dates as its values instead of integers... then taking that date range and finding dates specifiec between them (in a list of dates) and putting snap marks, so if you slide it near one of...
15
6492
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt accept other controls. The control i drag drop on it becomes the child of my custom control's parent form and not the child of my custom control. Then...
12
7271
by: Chris Shepherd | last post by:
Greetings group, I have a situation where I'd like to visibly see disabled dates on a DateTimePicker. Frequently the Min and Max dates in the picker will be set only to days apart, and so I would like this to be reflected in a way other than it simply failing to select when they click. It seems like this would be doable with a MonthCalendar...
6
3473
by: =?Utf-8?B?QmVu?= | last post by:
All - I have VB2008. On the form I have a date picker and a text box. I put would like to display a date format in the form of "MM-DD-YYYY" or "MM-YYYY" I am new to vb2008, can you show me how to do this? Thank you, Ben
0
7694
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7921
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7666
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6278
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5504
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.