473,683 Members | 3,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing DisplayNames of my properties using PropertyGrid component, how ??

Changing DisplayNames of my properties using PropertyGrid component, how ??

I'm using Delphi 2006 and I have a class defination like this:

TPerson = class
fPersonName : String;
fPersonSurName : String;
fPersonAge : Integer;
published
property PersonName : String read fPersonName write fPersonName;
property PersonSurname : String read fPersonSurname write fPersonSurname;
property PersonAge : Integer read fPersonAge write fPersonAge;
end;

and i want to display my class instance using PropertyGrid,so ...

var
mPerson : TPerson;
begin
mPerson := TPerson.Create;
mPerson.PersonN ame := 'Tugrul';
mPerson.PersonS urname := 'HELVACI';
mPerson.PersonA ge := 31;
PropertyGrid1.S electedObject := mPerson;
end;

at the above code i can see my class instance in the property grid.
But i want to change property display names in the propertygrid component.
Because of these, i was searching on the net and i found PropertyDescrip tor
abstract class
and ICustomTypeConv erter interface.

i implemented theese classes following:

TArrayOfAttribu te = array of Attribute;
TMyDescriptor = class(PropertyD escriptor)
private
base : PropertyDescrip tor;
fName: String;

function GetName : String;
function GetDisplayName : String;
function GetIsReadOnly : Boolean;
function GetComponentTyp e : &Type;
function GetPropertyType : &Type;

function GetCustomNames( baseName : String) : String; // my custom names
getter function
public
constructor Create(baseP : PropertyDescrip tor; filter :
TArrayOfAttribu te); overload; virtual;
constructor Create(baseP : PropertyDescrip tor); overload; virtual;

function CanResetValue(c omp : TObject) : Boolean;
function GetValue(comp : TObject) : TObject;

procedure ResetValue(comp : TObject);
procedure SetValue(comp : TObject; Value : TObject);
function ShouldSerialize Value(comp : TObject) : Boolean;
property Name : String read GetName;
property DisplayName : String read GetDisplayName;
property IsReadOnly : Boolean read GetIsReadOnly;
property ComponentType : &Type read GetComponentTyp e;
property PropertyType : &Type read GetPropertyType ;
end;

TMyClass = class(TInterfac edObject, ICustomTypeDesc riptor)
public
function GetProperties(f ilter : TArrayOfAttribu te) :
PropertyDescrip torCollection; overload;
function GetAttributes : AttributeCollec tion;
function GetClassName : String;
function GetComponentNam e : String;
function GetConverter : TypeConverter;
function GetDefaultEvent : EventDescriptor ;

function GetEvents(attri butes : TArrayOfAttribu te) :
EventDescriptor Collection; overload;
function GetEvents : EventDescriptor Collection; overload;
function GetDefaultPrope rty : PropertyDescrip tor;

function GetProperties : PropertyDescrip torCollection; overload;
function GetEditor(edito rBaseType : System.Type) : TObject;
function GetPropertyOwne r(pd : PropertyDescrip tor) : TObject;
end;
and my new TPerson class is:
TPerson = class(TMyClass)
fPersonName : String;
fPersonSurName : String;
fPersonAge : Integer;
published
property PersonName : String read fPersonName write fPersonName;
property PersonSurname : String read fPersonSurname write fPersonSurname;
property PersonAge : Integer read fPersonAge write fPersonAge;
end;

*************** * IMPLEMENTATIONS BELOW *************** *************** ***
{ TMyDescriptor }

function TMyDescriptor.C anResetValue(co mp: TObject): Boolean;
begin
Result := base.CanResetVa lue(comp);
end;
constructor TMyDescriptor.C reate(baseP: PropertyDescrip tor;
filter: TArrayOfAttribu te);
begin
inherited Create(baseP, filter);
Self.base := baseP;
end;

constructor TMyDescriptor.C reate(baseP: PropertyDescrip tor);
begin
inherited Create(baseP);
Self.base := baseP;
end;

function TMyDescriptor.G etComponentType : &Type;
begin
Result := base.ComponentT ype;
end;

function TMyDescriptor.G etDisplayName: String;
begin
Result := GetCustomNames( base.Name);
end;

function TMyDescriptor.G etir(baseName : String): String;
begin
if baseName = 'PersonName' then Result := 'Names of the Personel';
if baseName = 'PersonSurname' then Result := 'Surname of the personel';
if baseName = 'PersonAge' then Result := 'Age of the personel';
end;

function TMyDescriptor.G etIsReadOnly: Boolean;
begin
Result := base.IsReadOnly ;
end;

function TMyDescriptor.G etName: String;
begin
Result := base.Name;
end;
function TMyDescriptor.G etPropertyType: &Type;
begin
Result := base.PropertyTy pe;
end;

function TMyDescriptor.G etValue(comp: TObject): TObject;
begin
Result := base.GetValue(c omp);
end;
procedure TMyDescriptor.R esetValue(comp: TObject);
begin
base.ResetValue (comp);
end;

procedure TMyDescriptor.S etValue(comp, Value: TObject);
begin
base.SetValue(c omp, value);
end;

function TMyDescriptor.S houldSerializeV alue(comp: TObject): Boolean;
begin
Result := base.ShouldSeri alizeValue(comp );
end;

{ TMyClass }

function TMyClass.GetPro perties(
filter: TArrayOfAttribu te): PropertyDescrip torCollection;
var
baseProps : PropertyDescrip torCollection;
newProps : array of PropertyDescrip tor;
iCounter : Integer;
oldname,
newname : String;
begin
baseProps := TypeDescriptor. GetProperties(G etType(), filter);

SetLength(newPr ops, baseProps.Count );

for iCounter := 0 to baseProps.Count do
begin
newProps[iCounter] := TMyDescriptor.C reate(baseProps[iCounter], filter);
// An error occured : E2402 constructing instance of abstract class..
oldname := PropertyDescrip tor(baseProps[iCounter]).DisplayName;
newName := TMyDescriptor(n ewProps[iCounter]).DisplayName;
end;

Result := PropertyDescrip torCollection.C reate(newProps) ;
end;

function TMyClass.GetAtt ributes: AttributeCollec tion;
begin
Result := TypeDescriptor. GetAttributes(S elf, true);
end;

function TMyClass.GetCla ssName: String;
begin
Result := TypeDescriptor. GetClassName(Se lf, true);
end;

function TMyClass.GetCom ponentName: String;
begin
Result := TypeDescriptor. GetComponentNam e(Self, true);
end;

function TMyClass.GetCon verter: TypeConverter;
begin
Result := TypeDescriptor. GetConverter(Se lf, true);
end;

function TMyClass.GetDef aultEvent: EventDescriptor ;
begin
Result := TypeDescriptor. GetDefaultEvent (Self, true);
end;

function TMyClass.GetDef aultProperty: PropertyDescrip tor;
begin
Result := TypeDescriptor. GetDefaultPrope rty(Self, true);
end;

function TMyClass.GetEdi tor(editorBaseT ype: System.Type): TObject;
begin
Result := TypeDescriptor. GetEditor(Self, editorBaseType, true);
end;

function TMyClass.GetEve nts: EventDescriptor Collection;
begin
Result := TypeDescriptor. GetEvents(Self, true);
end;

function TMyClass.GetEve nts(
attributes: TArrayOfAttribu te): EventDescriptor Collection;
begin
Result := TypeDescriptor. GetEvents(Self, attributes, true);
end;

function TMyClass.GetPro perties: PropertyDescrip torCollection;
begin
Result := TypeDescriptor. GetProperties(S elf, true);
end;

function TMyClass.GetPro pertyOwner(pd: PropertyDescrip tor): TObject;
begin
Result := Self;
end;
I dont understand what is this. Can anybody helps me , how can i
subclassing PropertyDescrip tor class correctly ??
Even we take an error when using delphi.net , we dont take any error
message using c#,

i want change the display name of the property which is the added to my
special class by using the propertyGrid Component ...
It's seems like DisplayNameAtti rubute of the .net Framework 2.0

With My Best Regards,

Thanks For Helping
Dec 4 '06 #1
4 3300
I know enough about the component-model to answer this, but sadly my
object-pascal has slipped. I suggest you repost in a delphi ng.

In C#, can I point you here:
http://groups.google.co.uk/group/mic...42a0f66d6b3987

Cheers,

Marc
Dec 4 '06 #2
Of course, the simpler answer is to find how to set (fixed) attributes in
Delphi ;-p

Marc
Dec 4 '06 #3
I saw this posting in the following groups:

microsoft.publi c.dotnet.faqs
microsoft.publi c.dotnet.framew ork
microsoft.publi c.dotnet.framew ork.interop
microsoft.publi c.dotnet.framew ork.windowsform s
microsoft.publi c.dotnet.framew ork.windowsform s.controls
microsoft.publi c.dotnet.langua ges.csharp
microsoft.publi c.dotnet.genera l

When you post a message to multiple groups, please post all of
them at once. That way, if someone in one group provides a
solution, the solution will be posted to all of the groups.
Also, if someone in another group is working on a solution,
they will know it has been solved, and they can work on helping
somebody else.

Thanks,
Robin S.
---------------------------------
"Tugrul HELVACI" <ki************ @hotmail.comwro te in message
news:eU******** ******@TK2MSFTN GP04.phx.gbl...
Changing DisplayNames of my properties using PropertyGrid component, how
??

I'm using Delphi 2006 and I have a class defination like this:

TPerson = class
fPersonName : String;
fPersonSurName : String;
fPersonAge : Integer;
published
property PersonName : String read fPersonName write fPersonName;
property PersonSurname : String read fPersonSurname write fPersonSurname;
property PersonAge : Integer read fPersonAge write fPersonAge;
end;

and i want to display my class instance using PropertyGrid,so ...

var
mPerson : TPerson;
begin
mPerson := TPerson.Create;
mPerson.PersonN ame := 'Tugrul';
mPerson.PersonS urname := 'HELVACI';
mPerson.PersonA ge := 31;
PropertyGrid1.S electedObject := mPerson;
end;

at the above code i can see my class instance in the property grid.
But i want to change property display names in the propertygrid component.
Because of these, i was searching on the net and i found
PropertyDescrip tor abstract class
and ICustomTypeConv erter interface.

i implemented theese classes following:

TArrayOfAttribu te = array of Attribute;
TMyDescriptor = class(PropertyD escriptor)
private
base : PropertyDescrip tor;
fName: String;

function GetName : String;
function GetDisplayName : String;
function GetIsReadOnly : Boolean;
function GetComponentTyp e : &Type;
function GetPropertyType : &Type;

function GetCustomNames( baseName : String) : String; // my custom names
getter function
public
constructor Create(baseP : PropertyDescrip tor; filter :
TArrayOfAttribu te); overload; virtual;
constructor Create(baseP : PropertyDescrip tor); overload; virtual;

function CanResetValue(c omp : TObject) : Boolean;
function GetValue(comp : TObject) : TObject;

procedure ResetValue(comp : TObject);
procedure SetValue(comp : TObject; Value : TObject);
function ShouldSerialize Value(comp : TObject) : Boolean;
property Name : String read GetName;
property DisplayName : String read GetDisplayName;
property IsReadOnly : Boolean read GetIsReadOnly;
property ComponentType : &Type read GetComponentTyp e;
property PropertyType : &Type read GetPropertyType ;
end;

TMyClass = class(TInterfac edObject, ICustomTypeDesc riptor)
public
function GetProperties(f ilter : TArrayOfAttribu te) :
PropertyDescrip torCollection; overload;
function GetAttributes : AttributeCollec tion;
function GetClassName : String;
function GetComponentNam e : String;
function GetConverter : TypeConverter;
function GetDefaultEvent : EventDescriptor ;

function GetEvents(attri butes : TArrayOfAttribu te) :
EventDescriptor Collection; overload;
function GetEvents : EventDescriptor Collection; overload;
function GetDefaultPrope rty : PropertyDescrip tor;

function GetProperties : PropertyDescrip torCollection; overload;
function GetEditor(edito rBaseType : System.Type) : TObject;
function GetPropertyOwne r(pd : PropertyDescrip tor) : TObject;
end;
and my new TPerson class is:
TPerson = class(TMyClass)
fPersonName : String;
fPersonSurName : String;
fPersonAge : Integer;
published
property PersonName : String read fPersonName write fPersonName;
property PersonSurname : String read fPersonSurname write
fPersonSurname;
property PersonAge : Integer read fPersonAge write fPersonAge;
end;

*************** * IMPLEMENTATIONS BELOW *************** *************** ***
{ TMyDescriptor }

function TMyDescriptor.C anResetValue(co mp: TObject): Boolean;
begin
Result := base.CanResetVa lue(comp);
end;
constructor TMyDescriptor.C reate(baseP: PropertyDescrip tor;
filter: TArrayOfAttribu te);
begin
inherited Create(baseP, filter);
Self.base := baseP;
end;

constructor TMyDescriptor.C reate(baseP: PropertyDescrip tor);
begin
inherited Create(baseP);
Self.base := baseP;
end;

function TMyDescriptor.G etComponentType : &Type;
begin
Result := base.ComponentT ype;
end;

function TMyDescriptor.G etDisplayName: String;
begin
Result := GetCustomNames( base.Name);
end;

function TMyDescriptor.G etir(baseName : String): String;
begin
if baseName = 'PersonName' then Result := 'Names of the Personel';
if baseName = 'PersonSurname' then Result := 'Surname of the personel';
if baseName = 'PersonAge' then Result := 'Age of the personel';
end;

function TMyDescriptor.G etIsReadOnly: Boolean;
begin
Result := base.IsReadOnly ;
end;

function TMyDescriptor.G etName: String;
begin
Result := base.Name;
end;
function TMyDescriptor.G etPropertyType: &Type;
begin
Result := base.PropertyTy pe;
end;

function TMyDescriptor.G etValue(comp: TObject): TObject;
begin
Result := base.GetValue(c omp);
end;
procedure TMyDescriptor.R esetValue(comp: TObject);
begin
base.ResetValue (comp);
end;

procedure TMyDescriptor.S etValue(comp, Value: TObject);
begin
base.SetValue(c omp, value);
end;

function TMyDescriptor.S houldSerializeV alue(comp: TObject): Boolean;
begin
Result := base.ShouldSeri alizeValue(comp );
end;

{ TMyClass }

function TMyClass.GetPro perties(
filter: TArrayOfAttribu te): PropertyDescrip torCollection;
var
baseProps : PropertyDescrip torCollection;
newProps : array of PropertyDescrip tor;
iCounter : Integer;
oldname,
newname : String;
begin
baseProps := TypeDescriptor. GetProperties(G etType(), filter);

SetLength(newPr ops, baseProps.Count );

for iCounter := 0 to baseProps.Count do
begin
newProps[iCounter] := TMyDescriptor.C reate(baseProps[iCounter],
filter); // An error occured : E2402 constructing instance of abstract
class..
oldname := PropertyDescrip tor(baseProps[iCounter]).DisplayName;
newName := TMyDescriptor(n ewProps[iCounter]).DisplayName;
end;

Result := PropertyDescrip torCollection.C reate(newProps) ;
end;

function TMyClass.GetAtt ributes: AttributeCollec tion;
begin
Result := TypeDescriptor. GetAttributes(S elf, true);
end;

function TMyClass.GetCla ssName: String;
begin
Result := TypeDescriptor. GetClassName(Se lf, true);
end;

function TMyClass.GetCom ponentName: String;
begin
Result := TypeDescriptor. GetComponentNam e(Self, true);
end;

function TMyClass.GetCon verter: TypeConverter;
begin
Result := TypeDescriptor. GetConverter(Se lf, true);
end;

function TMyClass.GetDef aultEvent: EventDescriptor ;
begin
Result := TypeDescriptor. GetDefaultEvent (Self, true);
end;

function TMyClass.GetDef aultProperty: PropertyDescrip tor;
begin
Result := TypeDescriptor. GetDefaultPrope rty(Self, true);
end;

function TMyClass.GetEdi tor(editorBaseT ype: System.Type): TObject;
begin
Result := TypeDescriptor. GetEditor(Self, editorBaseType, true);
end;

function TMyClass.GetEve nts: EventDescriptor Collection;
begin
Result := TypeDescriptor. GetEvents(Self, true);
end;

function TMyClass.GetEve nts(
attributes: TArrayOfAttribu te): EventDescriptor Collection;
begin
Result := TypeDescriptor. GetEvents(Self, attributes, true);
end;

function TMyClass.GetPro perties: PropertyDescrip torCollection;
begin
Result := TypeDescriptor. GetProperties(S elf, true);
end;

function TMyClass.GetPro pertyOwner(pd: PropertyDescrip tor): TObject;
begin
Result := Self;
end;
I dont understand what is this. Can anybody helps me , how can i
subclassing PropertyDescrip tor class correctly ??
Even we take an error when using delphi.net , we dont take any error
message using c#,

i want change the display name of the property which is the added to my
special class by using the propertyGrid Component ...
It's seems like DisplayNameAtti rubute of the .net Framework 2.0

With My Best Regards,

Thanks For Helping

Dec 4 '06 #4
DisplayNameAttr ibute found in System.Componen tModel

Gabriel Lozano-Morán

"Tugrul HELVACI" <ki************ @hotmail.comwro te in message
news:eU******** ******@TK2MSFTN GP04.phx.gbl...
Changing DisplayNames of my properties using PropertyGrid component, how
??

I'm using Delphi 2006 and I have a class defination like this:

TPerson = class
fPersonName : String;
fPersonSurName : String;
fPersonAge : Integer;
published
property PersonName : String read fPersonName write fPersonName;
property PersonSurname : String read fPersonSurname write fPersonSurname;
property PersonAge : Integer read fPersonAge write fPersonAge;
end;

and i want to display my class instance using PropertyGrid,so ...

var
mPerson : TPerson;
begin
mPerson := TPerson.Create;
mPerson.PersonN ame := 'Tugrul';
mPerson.PersonS urname := 'HELVACI';
mPerson.PersonA ge := 31;
PropertyGrid1.S electedObject := mPerson;
end;

at the above code i can see my class instance in the property grid.
But i want to change property display names in the propertygrid component.
Because of these, i was searching on the net and i found
PropertyDescrip tor abstract class
and ICustomTypeConv erter interface.

i implemented theese classes following:

TArrayOfAttribu te = array of Attribute;
TMyDescriptor = class(PropertyD escriptor)
private
base : PropertyDescrip tor;
fName: String;

function GetName : String;
function GetDisplayName : String;
function GetIsReadOnly : Boolean;
function GetComponentTyp e : &Type;
function GetPropertyType : &Type;

function GetCustomNames( baseName : String) : String; // my custom names
getter function
public
constructor Create(baseP : PropertyDescrip tor; filter :
TArrayOfAttribu te); overload; virtual;
constructor Create(baseP : PropertyDescrip tor); overload; virtual;

function CanResetValue(c omp : TObject) : Boolean;
function GetValue(comp : TObject) : TObject;

procedure ResetValue(comp : TObject);
procedure SetValue(comp : TObject; Value : TObject);
function ShouldSerialize Value(comp : TObject) : Boolean;
property Name : String read GetName;
property DisplayName : String read GetDisplayName;
property IsReadOnly : Boolean read GetIsReadOnly;
property ComponentType : &Type read GetComponentTyp e;
property PropertyType : &Type read GetPropertyType ;
end;

TMyClass = class(TInterfac edObject, ICustomTypeDesc riptor)
public
function GetProperties(f ilter : TArrayOfAttribu te) :
PropertyDescrip torCollection; overload;
function GetAttributes : AttributeCollec tion;
function GetClassName : String;
function GetComponentNam e : String;
function GetConverter : TypeConverter;
function GetDefaultEvent : EventDescriptor ;

function GetEvents(attri butes : TArrayOfAttribu te) :
EventDescriptor Collection; overload;
function GetEvents : EventDescriptor Collection; overload;
function GetDefaultPrope rty : PropertyDescrip tor;

function GetProperties : PropertyDescrip torCollection; overload;
function GetEditor(edito rBaseType : System.Type) : TObject;
function GetPropertyOwne r(pd : PropertyDescrip tor) : TObject;
end;
and my new TPerson class is:
TPerson = class(TMyClass)
fPersonName : String;
fPersonSurName : String;
fPersonAge : Integer;
published
property PersonName : String read fPersonName write fPersonName;
property PersonSurname : String read fPersonSurname write
fPersonSurname;
property PersonAge : Integer read fPersonAge write fPersonAge;
end;

*************** * IMPLEMENTATIONS BELOW *************** *************** ***
{ TMyDescriptor }

function TMyDescriptor.C anResetValue(co mp: TObject): Boolean;
begin
Result := base.CanResetVa lue(comp);
end;
constructor TMyDescriptor.C reate(baseP: PropertyDescrip tor;
filter: TArrayOfAttribu te);
begin
inherited Create(baseP, filter);
Self.base := baseP;
end;

constructor TMyDescriptor.C reate(baseP: PropertyDescrip tor);
begin
inherited Create(baseP);
Self.base := baseP;
end;

function TMyDescriptor.G etComponentType : &Type;
begin
Result := base.ComponentT ype;
end;

function TMyDescriptor.G etDisplayName: String;
begin
Result := GetCustomNames( base.Name);
end;

function TMyDescriptor.G etir(baseName : String): String;
begin
if baseName = 'PersonName' then Result := 'Names of the Personel';
if baseName = 'PersonSurname' then Result := 'Surname of the personel';
if baseName = 'PersonAge' then Result := 'Age of the personel';
end;

function TMyDescriptor.G etIsReadOnly: Boolean;
begin
Result := base.IsReadOnly ;
end;

function TMyDescriptor.G etName: String;
begin
Result := base.Name;
end;
function TMyDescriptor.G etPropertyType: &Type;
begin
Result := base.PropertyTy pe;
end;

function TMyDescriptor.G etValue(comp: TObject): TObject;
begin
Result := base.GetValue(c omp);
end;
procedure TMyDescriptor.R esetValue(comp: TObject);
begin
base.ResetValue (comp);
end;

procedure TMyDescriptor.S etValue(comp, Value: TObject);
begin
base.SetValue(c omp, value);
end;

function TMyDescriptor.S houldSerializeV alue(comp: TObject): Boolean;
begin
Result := base.ShouldSeri alizeValue(comp );
end;

{ TMyClass }

function TMyClass.GetPro perties(
filter: TArrayOfAttribu te): PropertyDescrip torCollection;
var
baseProps : PropertyDescrip torCollection;
newProps : array of PropertyDescrip tor;
iCounter : Integer;
oldname,
newname : String;
begin
baseProps := TypeDescriptor. GetProperties(G etType(), filter);

SetLength(newPr ops, baseProps.Count );

for iCounter := 0 to baseProps.Count do
begin
newProps[iCounter] := TMyDescriptor.C reate(baseProps[iCounter],
filter); // An error occured : E2402 constructing instance of abstract
class..
oldname := PropertyDescrip tor(baseProps[iCounter]).DisplayName;
newName := TMyDescriptor(n ewProps[iCounter]).DisplayName;
end;

Result := PropertyDescrip torCollection.C reate(newProps) ;
end;

function TMyClass.GetAtt ributes: AttributeCollec tion;
begin
Result := TypeDescriptor. GetAttributes(S elf, true);
end;

function TMyClass.GetCla ssName: String;
begin
Result := TypeDescriptor. GetClassName(Se lf, true);
end;

function TMyClass.GetCom ponentName: String;
begin
Result := TypeDescriptor. GetComponentNam e(Self, true);
end;

function TMyClass.GetCon verter: TypeConverter;
begin
Result := TypeDescriptor. GetConverter(Se lf, true);
end;

function TMyClass.GetDef aultEvent: EventDescriptor ;
begin
Result := TypeDescriptor. GetDefaultEvent (Self, true);
end;

function TMyClass.GetDef aultProperty: PropertyDescrip tor;
begin
Result := TypeDescriptor. GetDefaultPrope rty(Self, true);
end;

function TMyClass.GetEdi tor(editorBaseT ype: System.Type): TObject;
begin
Result := TypeDescriptor. GetEditor(Self, editorBaseType, true);
end;

function TMyClass.GetEve nts: EventDescriptor Collection;
begin
Result := TypeDescriptor. GetEvents(Self, true);
end;

function TMyClass.GetEve nts(
attributes: TArrayOfAttribu te): EventDescriptor Collection;
begin
Result := TypeDescriptor. GetEvents(Self, attributes, true);
end;

function TMyClass.GetPro perties: PropertyDescrip torCollection;
begin
Result := TypeDescriptor. GetProperties(S elf, true);
end;

function TMyClass.GetPro pertyOwner(pd: PropertyDescrip tor): TObject;
begin
Result := Self;
end;
I dont understand what is this. Can anybody helps me , how can i
subclassing PropertyDescrip tor class correctly ??
Even we take an error when using delphi.net , we dont take any error
message using c#,

i want change the display name of the property which is the added to my
special class by using the propertyGrid Component ...
It's seems like DisplayNameAtti rubute of the .net Framework 2.0

With My Best Regards,

Thanks For Helping

Dec 4 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3768
by: Fred Chen | last post by:
Hi, I've created a custom component. I want one of the properties of my custom component to be the output file name which is found in project properties. I know that I can get this by writing a macro, but I would prefer doing this in my component's constructor. Currently I am trying to use ActiveSolutionProjects in the EnvDTE object to obtain the active project but it always returns an empty object.
3
5076
by: Martin Montgomery | last post by:
I have, for example, a property called myProperty. I would like, when using a property grid to display the property name as "My Property". Is this possible. Is there an attribute etc Thank Martin
5
6535
by: Lance | last post by:
I want to expose properties of a class to a user via a PropertyGrid class. Some of the properties are of type System.IO.FileInfo. Ideally, an OpenFileDialog window would appear when the user attempted to edit the value of the System.IO.FileInfo properties. Is there an existing UITypeEditor that will do this type of thing, or will I need to create my own Thanks Lance
3
1885
by: Phill. W | last post by:
(VB.Net 2003) I have a UserControl that exposes a number of public properties. When using this control on a.n.other Form, how can(?) I prevent the Forms Designer from adding code into InitializeComponent to set any or all of these properties when I save the form? There are one or two that I /might/ want set in this way, but I'd like to "persuade" the Designer to leave the rest well alone ...
0
1530
by: movieknight | last post by:
Hi, I have a class which I am feeding to the propertygrid, and I am exposing a Mesh object from my class for the propertygrid to display. I want the propertygrid to show the values (when you expand the property) and allow those values to be edited. My code is below. The grid is showing the values but they are read-only, although the other properties for the rest of my class are editable. Public Class MeshConverter
5
57852
by: Kimmo Laine | last post by:
Hi is there a way to change propertys attribute from the code? Let´s say that i have the following property in my class: public int Count } Is there a way to change the displayname, from my code, at runtime to "Number of bikes".
2
1634
by: Tugrul HELVACI | last post by:
I'm using Delphi 2006 and I have a class defination like this: TPerson = class fPersonName : String; fPersonSurName : String; fPersonAge : Integer; published property PersonName : String read fPersonName write fPersonName; property PersonSurname : String read fPersonSurname write fPersonSurname; property PersonAge : Integer read fPersonAge write fPersonAge;
0
1485
tbarto
by: tbarto | last post by:
Hello I need to get access to the content of PropertyGrid component that is a part of an application developed in C#. I need to do that from an external application, under windows API. The problem is, that I'm unable to find a description of that component at MSDN ( structures, messages, macros... ) Here is a link where I've been trying to find an info: ...
6
2771
by: ajk | last post by:
Hi I was wondering how to show different properties in design and run-mode for a user control? Is it possible to do this when implementing the System.ComponentModel.ICustomTypeDescriptor interface? e.g. when selecting the control from a toolbox with controls other properties show up when the program is in design mode than in run mode.
0
8568
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8504
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9043
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8753
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8771
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6429
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4519
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2934
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
3
1921
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.