Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Components
|
VB Components Issues specific to components in VB.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 4th, 2007, 03:05 AM
Registered User
 
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default SetValue doesn't work with DateTimePicker

I've written my own binding framework using PropertyInfo.SetValue(). It works fine on textboxes, labels, comboboxes and custom controls.

It doesn't work on the Value property of DateTimePicker, however. If I set it, and then read it back, it's correct. However, it does not bear any relation to what is displayed on the control's face.

Example:

  Dim [Object] As Object = DateTimePicker1
  Dim Value As New DateTime(2006, 08, 24)
  Dim P As PropertyInfo = [Object].GetType.GetProperty(MemberInfo.Name, FLAGS, Nothing, Nothing, ArgTypes.ToArray, Nothing)
  P.SetValue([Object], Convert.ChangeType(Value, P.PropertyType), Nothing, Nothing, Args, Nothing)


Please help!





Similar Threads
Thread Thread Starter Forum Replies Last Post
nullable datetimepicker.value Anar Visual Studio 2005 2 January 4th, 2010 04:29 PM
Syntax Error when updating data (setvalue) darrenb Access VBA 3 May 3rd, 2007 09:14 PM
dateTimePicker sconineuk General .NET 0 March 7th, 2006 11:22 AM
Problem in Code about "SetValue" arctica82 Pro VB.NET 2002/2003 2 April 15th, 2005 03:39 PM
Problem with Reflection.FieldInfo.SetValue method jaucourt Pro VB.NET 2002/2003 0 December 2nd, 2004 01:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.