473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Property Grid Help

First let me tell you i'm using vb.net 05 so please do not post any other language types thanks. On to the story. I'm using a custom class thatl lets each property get/set data from an INI file and i link this class to a property grid control on my main form. so with that said i have two questions.
1) i want one of the properties to be a browser to a file location ( i.e the old browsefor) then return the path to the property
2) i want to have several properties have a list for the user to choose from( i.e like a combobox) the combobox will contain the name of comm ports (i.e COM1, COM2 ect.)

i did do some research on the Property grid and found out how to make custom catagories. any help would be appriciated. Thanks

sample Property
Expand|Select|Wrap|Line Numbers
  1. Imports System.ComponentModel
  2. <DefaultPropertyAttribute("TesterType")> _
  3. Public Class TowerConFig
  4.     ' Dim Description As CategoryAttribute
  5.     Private strTesterType As String 'Used as a return
  6.     Private strTesterConfigfileloc As String = "C:\Documents and Settings\All Users\Tester\TesterConfig2.ini"
  7. #Region "Tester Info"
  8.     <CategoryAttribute("TesterInfo"), _
  9.            Browsable(True), _
  10.            [ReadOnly](False), _
  11.            BindableAttribute(False), _
  12.            DefaultValueAttribute(""), _
  13.            DesignOnly(False), _
  14.            DescriptionAttribute("Type of Tester")> _
  15.         Public Property TesterType() As String
  16.  
  17.         Get
  18.             Try
  19.                 strTesterType = GenProcs.GetINIValue("TesterInfo", "Type", strTesterConfigfileloc)
  20.                 Return strTesterType
  21.             Catch ex As Exception
  22.  
  23.             End Try
  24.  
  25.         End Get
  26.         Set(ByVal value As String)
  27.             Try
  28.                 If MsgBox("Over Write INI File Now?", MsgBoxStyle.OkCancel) = MsgBoxResult.Cancel Then Exit Property
  29.                 GenProcs.WriteINIValue("TesterInfo", "Type", value, strTesterConfigfileloc)
  30.             Catch ex As Exception
  31.  
  32.             End Try
  33.         End Set
  34.     End Property
  35.  
Feb 6 '08 #1
2 1188
Thanks for the quick replys(Not) but i figured it out on my own after searching the net. Guess i'll try another forum, maybe i'll have better luck see ya.
Feb 12 '08 #2
Plater
7,872 Expert 4TB
Well I don't what your problem was.
A Property grid shows properties. Add a property to the class and it shows up on the propertygrid, vola.
Feb 12 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Shanthi | last post by:
I am using property grid in C# application. Property grid displays the propeties properly. But I have some problem in displaying custom validation message. I have integer type property. When I...
4
by: Ananth | last post by:
I would like to know if we can enter properties (name-value pairs) dynamically into a property grid object using C#. Also is it possible to have the text in the property grid (within the indiidual...
6
by: Altman | last post by:
I would like to use an indexed property to access my private array of user controls. If I don't use an indexed property, the property will show up in my Properties Window during development. Is...
2
by: Mark Collard | last post by:
I've noticed that when you add a ToolTip component to a Form (or UserControl) the other controls on the form display a property in the property grid called "ToolTip on toolTip1", so you can set the...
0
by: Mark Collard | last post by:
When you add a ToolTip component to a Form (or UserControl) the other controls on the form display a ToolTip property in the property grid. This is because it implements the IExtenderProvider...
8
by: stephen | last post by:
Hi, I make use of properties to store values that are relevant to the page but this time I am posting the page to itself and the values are Zero or null (they disappear). is there any other way...
0
by: Hans Koller | last post by:
Hello group, I design a class to bind it to a property grid for easy modification of some settings. My problem is now that I want to raise an event when a settings has been changed. Thats not a...
0
by: Spoook | last post by:
Hi, I am trying to manage (add, remove) properties within the property grid (or window) in VS 2005 c# , but I can't do it. I read many forums, but none of them actually works. I don't have any...
1
by: asharda | last post by:
I have a custom property grid. I am using custom property grid as I do not want the error messages that the propertygrid shows when abphabets are entered in interger fields. The custom property...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.