Search
Group.AttachProportional Method
See Also
 



Attaches a new node to the group, in such a way that its area is always taking certain percentage of the main object's area.

 Syntax

VB6  Copy Code

Public Sub AttachProportional( _
    ByVal obj As Object, _
    ByVal left As Byte, _
    ByVal top As Byte, _
    ByVal right As Byte, _
    ByVal bottom As Byte _
)

C++  Copy Code

public:
void AttachProportional (
    IDispatch* obj,
    unsigned char left,
    unsigned char top,
    unsigned char right,
    unsigned char bottom
)

 Parameters

obj
The node that should be attached to the group.
left
The left side of the object's bounding rectangle, expressed as percent of main object's width.
top
The top side of the object's bounding rectangle, expressed as percent of main object's height.
right
The right side of the object's bounding rectangle, expressed as percent of main object's width.
bottom
The bottom side of the object's bounding rectangle, expressed as percent of main object's height.

 Remarks

Calling this method makes sense only if the main object of the group is either a box or a table. obj - the object that you attach, can be either a box or a table. The left, top, right and bottom arguments specify the position and size of the attached object relative to that of the main object. Their values must be expressed as percent of the main object's extents.

 Example

To create a box that displays an image in the top ¾ part of its area and text in its bottom ¼ part, you could use group of three boxes as show below. Note that in the given example the attached objects are locked. Users cannot select or modify them, and if they click one of them the main object is selected instead.

C#  Copy Code

group = fc.CreateGroup(boxMain);
group.AttachProportional(boxPict, 0, 0, 100, 75);
group.AttachProportional(boxText, 0, 75, 100, 100);
boxPict.LoadPicture(pictFile);
boxText.Text = strDescription;
boxPict.Locked = true;
boxText.Locked = true;

 See Also