lidds Posted May 25, 2005 Posted May 25, 2005 Does anyone know how to add a datetimepicker dropdown into a propertygrid in vb.net Cheers Simon Quote
Machaira Posted May 25, 2005 Posted May 25, 2005 I would imagine you'd have to have an object that had a DateTime as a property. Quote Here's what I'm up to.
stustarz Posted May 25, 2005 Posted May 25, 2005 If you add a property to the underlying class of your property grid that is set to Datetime then the Datetimepicker will automatically be shown for that field Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
lidds Posted May 25, 2005 Author Posted May 25, 2005 I don't suppose you could post example script in vb.net if possible, am new to vb.net. Thanks for your help Simon Quote
stustarz Posted May 25, 2005 Posted May 25, 2005 Public Property DateTime() As DateTime Get Return m_MyDateTime End Get Set(ByVal Value As DateTime) MyDateTime = Value End Set End Property That is an example of how to set up a property that the property grid can display, but what exactly are you trying to achieve - are you creating a user control or something and this is a property for the control, or are you actually using the PropertyGrid control on a form? Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
lidds Posted May 25, 2005 Author Posted May 25, 2005 I'm using the propertygrid control on the form and just wanted the datetimepicker to be displayed for that specific field. Thanks for the code, will give that ago later. Simon Quote
Machaira Posted May 25, 2005 Posted May 25, 2005 If you add a property to the underlying class of your property grid that is set to Datetime then the Datetimepicker will automatically be shown for that field Gee, I thought that's what I said. ;) :cool: Quote Here's what I'm up to.
lidds Posted May 26, 2005 Author Posted May 26, 2005 Thanks for everyones help, but as always another question. Is there a way that I can display a button (the same as appears sometimes '...') that would run a private sub. i.e. if I had a propertygrid field that when this button is clicked it says "hello world" Don't suppose again an example is possible. Cheers Simon Quote
Machaira Posted May 26, 2005 Posted May 26, 2005 I don't believe that's the purpose of the PropertyGrid. It's just meant to modify properties. Quote Here's what I'm up to.
lidds Posted May 26, 2005 Author Posted May 26, 2005 Yeah have figured that one out now..... have come across an excellent activex tool (totally free) which will do all I want in a listview http://vcreations.net/product.asp?pid=1 Quote
stustarz Posted May 27, 2005 Posted May 27, 2005 Yeah have figured that one out now..... have come across an excellent activex tool (totally free) which will do all I want in a listview http://vcreations.net/product.asp?pid=1 Shame its Active X and not managed .NET, but nice considering its free!! Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.