Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
hi I develped custom DateTimepicker in vb.net that users can pick date in persian lanquege with it.
in my main contrl class i have bindable property with name "Value". here is the property code :
VB
<Editor(GetType(TypeEditor), GetType(UITypeEditor)), Browsable(True), _
   Bindable(True)> _
   Public Property Value As String
       Get
           Return _DateValue
       End Get
       Set(ByVal Value As String)
           _DateValue = Value
           Me.Text = Value
           RaiseEvent ValueChanged(Me, New PropertyChangedEventArgs("Value"))
       End Set
   End Property

Whit this code everything is just fine except that when i made change to my control value datasource not updating. but strange part of my problem is that when i change property name to anything else(Like "Dvalue","DateValue"... ) everything working just fine.
sorry for my poor English
Thanks
Posted
Updated 24-Feb-12 23:50pm
v2
Comments
Ed Nutting 25-Feb-12 8:50am    
Your Set code uses the Value object to get the value passed to it. However, you have named your property Value so there is confusion in your code as to what to access. The only solution to this problem is to change the name of your property.

Hope this helps,
Ed
mostafaaa 25-Feb-12 9:21am    
I Know that but its not cause of my problem.
I changed "Value" in set code to "InValue" but my problem not solved.
Ed Nutting 25-Feb-12 9:24am    
I really don't know what's going wrong then... perhaps a search in Google (if you haven't already tried) might help you...
mostafaaa 25-Feb-12 9:30am    
Thanks anyway...
Sergey Alexandrovich Kryukov 25-Feb-12 18:40pm    
You don't show the handle of value changed event. It might miss or doing something wrong. You problem not in the code you are showing here.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900