473,549 Members | 5,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Property Grid Help

4 New Member
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 1196
dwillis
4 New Member
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 Recognized Expert Expert
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
9237
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 give invalid values for the property it is throwing System exception as follows. "Invalid Property Value. Is not a valid value for Int32. Though I...
4
414
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 sections) show up in different fonts(bold, italics etc). Ananth
6
1858
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 there a way to get this to show up in the properties window?
2
4892
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 tooltip text on the selected control. I'm currently writing my own component, and I want to add the same functionality to the component, so that...
0
1469
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 interface and other bits and pieces. I've looked at examples on the following pages, but none of them show how to add a property that returns a class...
8
2250
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 I can store them/preserve them so that when I post back I can use the values. I tried session and it works but some other ideas would be helpful. ...
0
1502
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 problem with some "normal" properties (see property DisplayGrid). But when I use a subclass and TypeConverter the setter of the property is not...
0
840
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 problems with adding new properties, but when i try to remove one from the property grid it won't disappear. I tried the following: public new...
1
4371
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 grid doesn't show colloections i.e. if I have a List<Objectthen the Collection is shown but when I click on the "..." button next to it nothing...
0
7526
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7455
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7480
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6050
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5373
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3504
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.