Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

   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?

Visit: VBSourceSeek - The VB.NET sourcecode library

 

 

"A mere friend will agree with you, but a real friend will argue."
Posted

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

Posted
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:

Here's what I'm up to.
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...