473,568 Members | 2,898 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 3294
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
3729
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...
3
5072
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
6528
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...
3
1880
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...
0
1524
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...
5
57802
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
1628
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...
0
1480
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...
6
2763
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
7916
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. ...
0
8117
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7962
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...
0
6275
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
5498
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
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
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
932
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.