XSalToolbox
Namespace: PPJ.Runtime.XSal
Assembly: PPJ.Web.XSal.50 (5.0.0.0)
Hosts controls in a named toolbox that docks into the XSal toolbar strips of a form.
- C#
- VB.NET
public class XSalToolbox : SalDialogBox
Public Class XSalToolbox
Inherits SalDialogBox
The named template supplied to Create must resolve to a class derived from XSalToolbox.
Example:
SalForm form = new SalForm();
XSalToolbox toolbox = XSalToolbox.Create(
"MyToolbox", form, XSal.ToolboxPositions.Top, XSal.ToolboxFlags.Visible);
Constructors
XSalToolbox()
Initializes a toolbox dialog.
Properties
Position
ToolboxPositions: Gets the parent toolbar’s docking position, or moves the toolbox to a specified edge toolbar.
Top, Right, Bottom, and Left are supported assignments. None and other values do not detach or float the toolbox.
Methods
Create(name, form, position, flags)
Initializes a form’s toolbar system and creates a named toolbox template as a child.
| Parameter | Type | Description |
|---|---|---|
| name | String | The toolbox template class name. |
| form | Form | The parent form. |
| position | ToolboxPositions | The toolbar edge where the toolbox is docked. |
| flags | ToolboxFlags | Toolbox flags; Visible determines its initial visibility. |
Returns: XSalToolbox. The new toolbox, or null if the named window cannot be created.
Throws:
- ArgumentNullException form is null.
- ArgumentException The created template is not derived from XSalToolbox.
FromHandle(handle)
Resolves a control handle and casts it to XSalToolbox.
| Parameter | Type | Description |
|---|---|---|
| handle | SalWindowHandle | The toolbox window handle. |
Returns: XSalToolbox. The toolbox, or null if the handle resolves to no control.
FromName(form, name)
Finds a toolbox by its exact control name among the form’s docked and floating toolboxes.
| Parameter | Type | Description |
|---|---|---|
| form | Form | The containing form, or null. |
| name | String | The case-sensitive toolbox name. |
Returns: XSalToolbox. The first matching toolbox, or null when the form, toolbar system, or named toolbox is absent.
GetMetrics(type)
Gets a shared toolbar size or child-layout offset.
| Parameter | Type | Description |
|---|---|---|
| type | ToolbarMetrics | Height, Width, LeftOffset, or TopOffset. |
Returns: Int32. The metric in pixels, or zero for an unsupported metric.
LayoutChildren()
Arranges toolbox children after a docking-position change.
The current implementation uses horizontal child layout for all four docking edges.
SetMetrics(value, type)
Sets a shared toolbar size or child-layout offset.
| Parameter | Type | Description |
|---|---|---|
| value | Int32 | The metric value in pixels. |
| type | ToolbarMetrics | Height, Width, LeftOffset, or TopOffset. Other values are ignored. |
Implements
| Name | Description |
|---|---|
| ISalWindow |