Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

CalcSize Method, CheckBoxPartClass Class

Calculates the size of the part.

Class: CheckBoxPartClass
Namespace: Softelvdm.Controls
Assembly: Softelvdm.SftTreeNET

Syntax

protected internal new Size CalcSize(
    PartsRenderingClass pr,
    Graphics g,
    Rectangle rPartArea,
    CalcSizeEnum calc );
Protected Friend Overrides Function CalcSize(
    ByVal pr As PartsRenderingClass,
    ByVal g As Graphics,
    ByVal rPartArea As Rectangle,
    ByVal calc As CalcSizeEnum
  ) As Size

Parameters

pr

Defines the PartsRenderingClass object.

g

Defines the drawing surface.

rPartArea

Defines the maximum available area to render the part.

calc

Defines the method to calculate the part's size.

Return Value

The part's size.

Comments

Calculates the size of the part.

If a part can adapt to its surroundings and its maximum available space (r), it should adjust the returned size to reflect the maximum available space. For example, a string as used in the TextPartClass class can wrap around. If a part is wider than the available space, it may be clipped once it is displayed.

Calculating a part's size can be CPU intensive, in which case this routine should attempt to cache values to speed up its performance. The calc parameter can be used to distinguish the reason for the call to CalcSize, which may be helpful to cache values needed to optimize performance.

See Also CheckBoxPartClass Class | Classes | SftTree/NET 2.0