datetimpicker in property grid...

lidds

Junior Contributor
Joined
Nov 9, 2004
Messages
210
Does anyone know how to add a datetimepicker dropdown into a propertygrid in vb.net

Cheers

Simon
 
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
 
I don't suppose you could post example script in vb.net if possible, am new to vb.net.

Thanks for your help

Simon
 
Visual Basic:
    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?
 
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
 
stustarz said:
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:
 
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
 
Back
Top