Thickness constructor
constructor · Thickness · cAlgo.API
DesktopCLICloud
Initializes a new instance of the Thickness structure.
Overloads
| Signature |
|---|
Thickness(double left, double top, double right, double bottom) |
Thickness(double uniformLength) |
Thickness(double left, double top, double right, double bottom)
Initializes a new instance of the Thickness structure.
public Thickness(double left, double top, double right, double bottom)
Thickness(left: float, top: float, right: float, bottom: float)
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
left | double | float | |
top | double | float | |
right | double | float | |
bottom | double | float |
Examples
var button = new Button { Text = "Buy", Margin = new Thickness(10, 5, 10, 5) };
Chart.AddControl(button);
Print("Left margin: {0}", button.Margin.Left);
button = Button()
button.Text = "Buy"
button.Margin = Thickness(10, 5, 10, 5)
api.Chart.AddControl(button)
api.Print(f"Left margin: {button.Margin.Left}")
Thickness(double uniformLength)
Initializes a new instance of the Thickness structure.
public Thickness(double uniformLength)
Thickness(uniformLength: float)
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
uniformLength | double | float |
Examples
var border = new Border { BorderThickness = new Thickness(2), BorderColor = Color.Gray, Padding = new Thickness(8) };
border.Child = new TextBlock { Text = "Risk: 1%" };
Chart.AddControl(border);
border = Border()
border.BorderThickness = Thickness(2)
border.BorderColor = Color.Gray
border.Padding = Thickness(8)
textBlock = TextBlock()
textBlock.Text = "Risk: 1%"
border.Child = textBlock
api.Chart.AddControl(border)