Home > Back-end >  A problem about add attributes to control
A problem about add attributes to control

Time:09-27

I under a control online



This control, and then use is inside Rzline,


Because I feel want to give it to add a can be used to attribute, this is the endpoint at the ends of the line segment to add attributes, displays the coordinates, can be seen in the properties monitor,
Add a one endpoint,
How to do?

CodePudding user response:

Design according to basic solution, unless you start from the component source code change, if you understand and have a source code,

CodePudding user response:

I think from this space derived a inside, and then add an attribute, become the new controls

CodePudding user response:

Can inherit it, and derived a new control, increase the corresponding property a, but if you want to display, still have to drawing, is more complex,

CodePudding user response:

Quote: refer to the third floor lyhoo163 response:

Can inherit it, and derived a new control, increase the corresponding property a, but if you want to display, still have to drawing, is more complex,


Can you help me to write the source code, can only display attribute

CodePudding user response:

CodePudding user response:

Add a simple attributes displayed, but the key is to allow application properties, is more complex,

CodePudding user response:

refer to 6th floor lyhoo163 response:
add a simple attributes displayed, but the key is to allow application properties, is more complex,




Hello I just leave it as it is, displayed,

CodePudding user response:

Because want to through this property to determine two endpoints of a line segment

CodePudding user response:

The unit RzLine3;

Interface

USES the
Windows, SysUtils, Classes, Controls, RzLine;

Type
TRzLine3=class (TRzLine)
Private
Fpoint: TPoint;
Procedure setpoint (value: TPoint);
{Private declarations}
Protected
The property onepoint: TPoint read Fpoint write setpoint;
{Protected declarations}
Public
{Public declarations}
Published
{Published declarations}
The end;

Procedure Register;

Implementation

Procedure Register;
The begin
RegisterComponents (' Samples' [TRzLine3]);
The end;
Procedure TRzLine3. Setpoint (value: TPoint);
The begin
Fpoint:=value;

The end;
end.
  • Related