Visual Basic, .NET, ASP, VBScript
 

   
   
     

Форум - .NET

Страница: 1 |

 

  Вопрос: PropertyGrid. Как ним управлять? Кто знает? Добавлено: 23.03.04 03:19  

Автор вопроса:  Oleg K

Попоробовал залить свойства класса в PropertyGrid мне понравилось, появился недостаток именование свойств в PropertyGrid, так как это именовано в классе (ангельскими буквами) - нашел пример как это настроить под себя.

Но теперь стоит вопрос как же данными в PropertyGrid управлять? Т.е. хочу сделать так, что если выбрано значение такого то свойства, значит вот такие-то свойства будут не доступны для редактирования и т.д.

Не могу понять где этим править, PropertyGrid изменяет реально значения свойств или я должен управлять этим в ручную. Подскажите кто знает?

Ответить

  Ответы Всего ответов: 2  

Номер ответа: 1
Автор ответа:
 Павел



Администратор

ICQ: 326066673 

Вопросов: 368
Ответов: 5968
 Web-сайт: www.vbnet.ru
 Профиль | | #1
Добавлено: 23.03.04 08:21
В MSDN есть хорошая статья о PropertyGrid...

"Getting the Most Out of the .NET Framework PropertyGrid Control"
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dndotnet/html/usingpropgrid.htm

Вот цитата по поводу Вашего вопроса...

---
To change how some properties are displayed, you can apply different attributes to the properties. Attributes are declarative tags used to annotate programming elements such as types, fields, methods, and properties that can be retrieved at run time using reflection. Here is a partial list:

- DescriptionAttribute. Sets the text for the property that is displayed in the description help pane below the properties. This is a useful way to provide help text for the active property (the property that has focus). Apply this attribute to the MaxRepeatRate property.
- CategoryAttribute. Sets the category that the property is under in the grid. This is useful when you want a property grouped by a category name. If a property does not have a category specified, then it will be assigned to the Misc category. Apply this attribute to all properties.
- BrowsableAttribute v Indicates whether the property is shown in the grid. This is useful when you want to hide a property from the grid. By default, a public property is always shown in the grid. Apply this attribute to the SettingsChanged property.
- ReadOnlyAttribute v Indicates whether the property is read-only. This is useful when you want to keep a property from being editable in the grid. By default, a public property with get and set accessor functions is editable in the grid. Apply this attribute to the AppVersion property.
- DefaultValueAttribute v Identifies the property's default value. This is useful when you want to provide a default value for a property and later determine if the property's value is different than the default. Apply this attribute to all properties.
- DefaultPropertyAttribute v Identifies the default property for the class. The default property for a class gets the focus first when the class is selected in the grid. Apply this attribute to the AppSettings class.
---

Ответить

Номер ответа: 2
Автор ответа:
 Oleg K



Вопросов: 15
Ответов: 72
 Профиль | | #2 Добавлено: 24.03.04 16:04

Спасибо.

Ответить

Страница: 1 |

Поиск по форуму



© Copyright 2002-2011 VBNet.RU | Пишите нам