Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > VB.NET > Component Development

Component Development Development of components with VB.NET

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-25-2009, 8:39 PM
VB.NET Forum Newbie
.NET Framework: .NET 2.0
 
Join Date: Jun 2007
Posts: 4
Reputation: 0
elmowatson is on a distinguished programming path ahead
Default Property Grid Selectors

I am learning about the PropertyGrid control and I've got the basics - loading the properties of a control into the PropertyGrid, but I came across something I need help with

I see that there are certain properties which need 'selecting', but nothing is built in for that. So this is opening lots of questions in my mind.

Let's say I have a path or image that needs to be assigned to the property - in the PropertyGrid control, there is only a blank area. In VS.Net, there would be a button with 3 dots, to click on, to open an openfiledialog and find the image or file to put there.

Or sometimes, there'll be a property, but with that particular control, there are only a certain number of predefined items which would be listed in a dropdown list, inside the PropertyGrid.

How can I do things like this? Can someone point me to a VB.Net tutorial or code sample which shows these kinds of things (I don't even know what to call them, in order to do a search)?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-26-2009, 5:38 AM
JohnH's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2005
Location: Norway
Age: 37
Posts: 10,325
Reputation: 1315
JohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond repute
Default

Quote:
Originally Posted by elmowatson View Post
Let's say I have a path or image that needs to be assigned to the property - in the PropertyGrid control, there is only a blank area. In VS.Net, there would be a button with 3 dots, to click on, to open an openfiledialog and find the image or file to put there.
This can be done applying a UITypeEditor attribute, the FileNameEditor Class (System.Windows.Forms.Design) is the standard.
Quote:
Or sometimes, there'll be a property, but with that particular control, there are only a certain number of predefined items which would be listed in a dropdown list, inside the PropertyGrid.
Usually this is a property defined simply as some Enum type, see for example Enum Class (System). The link below show also another way, where some defaults are provided for a String type property.
Quote:
How can I do things like this? Can someone point me to a VB.Net tutorial or code sample which shows these kinds of things (I don't even know what to call them, in order to do a search)?
Here is one that explains many things: Getting the Most Out of the .NET Framework PropertyGrid Control
Search the web for specifics once you find keywords you don't understand or want to expand on.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 2:41 AM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.