Welcome

CH Splitter 1.0

'CH Splitter' is an ActiveX component, that enables you to split Forms and UserControls into several sections, whose size can be adjusted by the user. Thereby it's possible to create flexible user interfaces, similar to Outlook Express.

This help file is supplied with version 1.0.

1. Installation and Registration

2. Getting started

3. Parts CH Splitter consist of

CH Splitter consist of 3 parts:

  • Split Control - the actual control, which is placed on a Form\UserControl and is used as a container
  • Section Object - represents a section (= part of the total area) on the Split control
  • Sections Collection - Collection of Section objects that are assigned to a Split control

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD 'AS IS' AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED. Test the program thoroughly with non-critical data before relying on it. The user must assume the entire risk of using the program. ANY LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE PRICE.


Installation und Registration

Installation and Registration

Installation:

1. In WinZip press "Install" or doubleclick Setup.exe.

2. Follow the installation instructions.

3. Open the Components dialog in VB (Project | Components) and select "CH Splitter 1.0 Trial Version".

Several sample projects are included in the zip file to demonstrate the different possibilities of using "CH Splitter".

If you have any comments\suggestions or found a bug, please contact me: CHuebner@ch-software.de

Registration:

You can register your copy of 'CH Splitter' through www.ShareIt.com. Registration fee: US$ 25.00

The complete VB6 source code is available for US$ 90.00 and can easily be compiled into your VB6 applications.


Getting started

1. Create a new project with a Form.

2. Add a new Split control to the Form. It will automatically be aligned at the left of the Form.

3. Add 2 TreeViews (Appearance = ccFlat) to the Split control and 1 ListView (BorderSryle = ccNone) to the Form.

4. Insert the following code in the Load EventHandler of the Form. This will add two sections to the Split control:

Dim secX As Section
With Split1.Sections
  Set secX = .Add("Sektion1", "Sektion 1", , TreeView1)
  Set secX = .Add("Sektion2", "Sektion 2", , TreeView2)
End With
Set Split1.OuterControl = ListView1

5. Insert the following code in the Resize EventHandler of the Form:

Split1.Refresh

6. Insert the following code in the ReArrange EventHandler of the Split control. This code ensures that the two sections will always appear equal in size. ClientSize returns the available space on the Split control. CountVisible returns the number of visible sections. The available space is divided by the number of visible sections and than assigned to the Size property of each section:

Dim Sec As Section
Dim SectionNumber As Long
Dim SizeH As Single
If ReArrangeType = splReArrangeType.splNormal Then
   With Split1
     SectionNumber = .Sections.CountVisible
     If SectionNumber = 0 Then Exit Sub
     SizeH = .ClientSize / SectionNumber
     For Each Sec In .Sections
       If Sec.Visible Then Sec.Size = SizeH
     Next Sec
    .Refresh
   End With
End If

7. Start the project.


Split Control

Properties Methods Events

A Split control is used to split a Form\UserControl into two regions, whose size can be adjusted by the user with the help of the mouse. The first region is formed by the Split control itself, which acts as a container for one or more controls (e.g. TreeView). The second region is filled out by any desired control (e.g. ListView). The special feature is that the Split control itself can be subdivided into different sections. You can then assign any control to each of these sections.

Syntax

Split

Remarks

After having created a Split control, you can subdivide it into several regions (sections) by adding Section objects to the Sections collection. By default each section consists of a head showing a caption and a body, on which you can place a control. Similar to the Split control, the size of each section can be adjusted by the user.

With the help of the OuterControl property you can specify a control that will fill out the free region (= the region not occupied by the Split control) on the container (Form\UserControl) and that will automatically be adjusted when the size of the Split control is changed.

Usually a Split control is aligned to one of the four edges of its container (Align property is e.g. set to vbAlignLeft). But it is also possible to use a none-aligned Split control (vbAlignNone) as the OuterControl of another Split control. You can even go further and fill out each of the sections with another instance of a none-aligned Split control. This flexibility allows you to create any possible subdivision of a Form\UserControl.


ClientSize Property

Returns the horizontal or vertical area (depends on the align of the Split control) that is available to display the sections.

Not available at design time. Read only.

Syntax

Split.ClientSize

Remarks

The scale unit of the Split control's container is used.

If the Split control is aligned vertically (vbAlignLeft or vbAlignRight), the ClientSize property returns the same value as the ScaleHeight property. If the Split control is aligned horizontally (vbAlignTop or vbAlignBottom), the value of the ScaleHeight property is returned (not in twips but in the container's scale unit!).

The advantage of using the ClientSize property instead of ScaleWidth\ScaleHeight is that you don't have to care about the current align (horizontal\vertical) of the Split control and that no conversion of scale units is necessary.

For example, the following code ensures that all visible sections are equal in size. The current align of the Split control doesn't matter:

Dim Sec As Section
Dim SectionNumber As Long
Dim NewSize As Single

With Split1
  SectionNumber = .Sections.CountVisible
  If SectionNumber = 0 Then Exit Sub
  NewSize = .ClientSize / SectionNumber
  For Each Sec In .Sections
      If Sec.Visible Then Sec.Size = NewSize
  Next Sec
  .Refresh
End With

Note that both the ClientSize property and the Size property of the Section objects use the scale unit of the Split control's container. Therefore no conversion of scale units is necessary as it would be the case if ScaleWidth\ScaleHeight was used instead of ClientSize!


InnerBorderSize Property

Returns or sets the distance between sections. The free area between two sections allows the user to change the size of the sections with the help of the mouse.

Syntax

Split.InnerBorderSize [= number]

Remarks

The default value is 4 pixels.

The scale unit of the Split control's container is used.

If you change this property at runtime, you have to invoke the Refresh method for the change to take effect.


InnerResizeDirect Property

Returns or sets a value that specifies if the size of the sections will change immediately during the adjustment by the user or if first a dotted strip will be shown.

Syntax

Split.InnerResizeDirect [= boolean]

Settings

The settings for boolean are:

Constant | Description
True | (Default) The sections will be resized immediately.
False | First a dotted strip will be shown. The adjustment of size will take place when the user releases the mouse button.

Remarks

Set this property to False in order to avoid flickering if the controls placed on the Split control have to be painted time-consumingly.


MarginOppositeResize Property

Returns or sets the height\width of the outer border which lies in the opposite of the border used to resize the Split control. This property refers to the left border if the Split control is at the left of the container (vbAlignLeft).

Syntax

Split.MarginOppositeResize [= number]

Relation between the align of the Split control and the border that the MarginOppositeResize property refers to:

Align | Referenced border
vbAlignLeft | left border
vbAlignRight | right border
vbAlignTop | top border
vbAlignBottom | bottom border

Remarks

The default value is 0.

The scale unit of the Split control's container is used.

If the Split control is not aligned (vbAlignNone), the referenced border depends on the VerticalIfNoAlign property.

If you change this property at runtime, you have to invoke the Refresh method for the change to take effect.


MarginVBottomHRight Property

Returns or sets the height of the bottom border if the Split control is aligned vertically (vbAlignLeft\vbAlignTop) or the width of the right border if the Split control is aligned horizontally (vbAlignTop\vbAlignBottom).

Syntax

Split.MarginVBottomHRight [= number]

Relation between the align of the Split control and the border that the MarginVBottomHRight property refers to:

Align | Referenced border
vbAlignLeft, vbAlignRight | bottom border
vbAlignTop, vbAlignBottom | right border

Remarks

The default value is 0.

The scale unit of the Split control's container is used.

If you change this property at runtime, you have to invoke the Refresh method for the change to take effect.


MarginVTopHLeft Property

Returns or sets the height of the top border if the Split control is aligned vertically (vbAlignLeft\vbAlignTop) or the width of the left border if the Split control is aligned horizontally (vbAlignTop\vbAlignBottom).

Syntax

Split.MarginVTopHLeft [= number]

Relation between the align of the Split control and the border that the MarginVTopHLeft property refers to:

Align | Referenced border
vbAlignLeft, vbAlignRight | top border
vbAlignTop, vbAlignBottom | left border

Remarks

The default value is 0.

The scale unit of the Split control's container is used.

If you change this property at runtime, you have to invoke the Refresh method for the change to take effect.


MaxSizeByUser Property

Returns or sets the maximum width\height of the Split control, that can be adjusted by the user with the help of the mouse.

Syntax

Split.MaxSizeByUser [= number]

Remarks

The default value is 0 (no limitation of the maximum width\height). Nevertheless the actual maximum width\height, which the user can adjust with the help of the mouse, is equal to or smaller than the width\height of the Split control's container.

The scale unit of the Split control's container is used.


MinSizeByUser Property

Returns or sets the minimum width\height of the Split control, that can be adjusted by the user with the help of the mouse.

Syntax

Split.MinSizeByUser [= number]

Remarks

The default value is 0 (no minimum width\height). Nevertheless the minimum width\height, which the user can adjust with the help of the mouse, is at least equal to the value returned by the ResizeBorderSize property of the Split control.

The scale unit of the Split control's container is used.


OuterControl Property

Returns or sets the control that occupys the free client area of the container.

Not available at design time.

Syntax

Split.OuterControl

Set Split.OuterControl = Control

Remarks

Control has to be situated on the Split control's container. If Control has an Align property, it must be set to vbAlignNone.

If you change this property at runtime, you have to invoke the Refresh method for the change to take effect.


OuterResizeDirect Property

Returns or sets a value that specifies if the size of the Split control will change immediately during the adjustment by the user or if first a dotted strip will be shown.

Syntax

Split.OuterResizeDirect [= boolean]

Settings

The settings for boolean are:

Setting | Description
True | The Split control will be resized immediately.
False | (Default) First a dotted strip will be shown. The adjustment of size will take place when the user releases the mouse button.

Remarks

Set this property to False in order to avoid flickering if the controls placed on the Split control or the OuterControl have to be painted time-consumingly.


Resizeable Property

Resizeable Property (Split Control, Section Object)

Returns or sets a value that specifies if the size can be adjusted by the user with the help of the mouse.

Syntax

object.Resizeable [= boolean]

The object placeholder represents an object expression that evaluates to a Split control or a Section object.

Settings

The settings for boolean are:

Setting | Description
True | (Default) The size can be adjusted.
False | The size can not be adjusted.

Remarks

If the Resizeable property of a Split control is set to False, the Split control's size can not be adjusted by the user. Therefore the sections are not affected, however, and continue to be resizeable (as long as their Resizeable property is True).

If you change this property at runtime, you have to invoke the Refresh method for the change to take effect.


ResizeBorderSize Property

Returns or sets the height\width (depends on the align of the Split control) of the outer border which is used to resize the Split control. This property refers to the right border if the Split control is at the left of the container (vbAlignLeft).

Syntax

Split.ResizeBorderSize [= number]

Relation between the align of the Split control and the border that the ResizeBorderSize property refers to:

Align | Referenced border
vbAlignLeft | right border
vbAlignRight | left border
vbAlignTop | bottom border
vbAlignBottom | top border

Remarks

The default value is 4 pixels.

The scale unit of the Split control's container is used.

If the Split control is not aligned (vbAlignNone), the referenced border depends on the VerticalIfNoAlign property.

If you change this property at runtime, you have to invoke the Refresh method for the change to take effect.


ScaleLeft, ScaleTop Properties (Split Control)

Return the horizontal (ScaleLeft) and vertical (ScaleTop) coordinates for the left and top edges of a Split control.

Not available at design time. Read only.

Syntax

Split.ScaleLeft

Split.ScaleTop

Remarks

These properties are always specified in twips.

Using the Split control these properties are normally not needed because they have just been implemented to complete the ScaleWidth, ScaleHeight, and ClientSize properties.


ScaleHeight, ScaleWidth Properties (Split Control)

Return the number of units for the vertical (ScaleHeight) and horizontal (ScaleWidth) measurement of the Split control's interior that is available for the sections.

Not available at design time. Read only.

Syntax

Split.ScaleHeight

Split.ScaleWidth

Remarks

These properties are always specified in twips.

If the Split control is aligned vertically (vbAlignLeft or vbAlignRight), the ScaleWidth property is equal to the width of the Split control minus the left and right margins. In contrast to that, the ScaleHeight property is equal to the height of the Split control minus the top margin, the bottom margin and X times the value of the InnerBorderSize property, whereby X is the number of sections - 1 (X >= 0).

With the help of the ScaleHeight and ScaleWidth properties you can get the available area, which has to be shared among all sections. If, for example, all sections of a vertically aligned Split control should be equal in size (in this case: equal in height), you have to divide the value of the ScaleHeight property by the number of (visible) sections. Then you have to assign this value to the Size property of each Section object. With a Split control aligned horizontally, however, you would have to use the ScaleWidth property instead of the ScaleHeight property. In order to be independent from the current align of the Split control you should use the ClientSize Property!


Sections Property

Returns a reference to a collection of Section objects of a Split control.

Not available at design time. Read only.

Syntax

Split.Sections

Remarks

You can change, add or remove Section objects using standard collection methods (for example, the Add and Remove methods). You can access each element in the collection by its index (1-based), or by a unique key that you store in the Key property.


VerticalIfNoAlign Property

Returns or sets a value that specifies whether the sections will be tiled horizontally or vertically if the Split control is none-aligned (vbAlignNone).

Syntax

Split.VerticalIfNoAlign [= boolean]

Settings

The settings for boolean are:

Setting | Description
True | (Default) The sections are tiled horizontally (one upon the other). The Split control is displayed as if it was aligned vertically (vbAlignLeft or vbAlignRight). The ResizeBorderSize property refers to the left border of the Split control.
False | The sections are tiled vertically (among each other). The Split control is displayed as if it was aligned horizontally (vbAlignTop or vbAlignBottom). The ResizeBorderSize property refers to the top border of the Split control.

Remarks

This property is significant if the Split control is none-aligned (Align property is set to vbAlignNone). In this case the size of the Split control can not be changed by the user.

A none-aligned Split control can also be used as an OuterControl of another Split control or as a ContainedControl of a section. In this case it is especially useful to be able to decide whether the sections of the none-aligned Split control are tiled horizontally or vertically.


Refresh Method

Refreshes (repaints) the Split control.

Syntax

Split.Refresh

Remarks

Use the Refresh method for changes on the Split control or Section objects to take effect. If you change the color of the Section object's font, it is necessary to invoke the Refresh method:

Split.Sections(1).HeadForeColor = vbRed
Split.Refresh


ClickAway Event

Occurs when the cross in the head of a section is clicked by the user in order to make it invisible.

Syntax

Private Sub Split_ClickAway(Sec As chSplitter.Section, Cancel As Boolean)

The ClickAway event syntax has these parts:

Part | Description
Split | A Split control.
Sec | A reference to the Section object that has been clicked by the user.
Cancel | A boolean expression that defines whether the current section will be made invisible or not. If Cancel remains False then the section will be made invisible. If the current section is the only visible section then the entire Split control will be made invisible. Setting Cancel to True will cause the section to remain visible.

Remarks

After all sections have been made invisible by the user the entire Split control is made invisible and afterwards the Invisible event occurs. When you want to restore the original state it is necessary to make all sections and the Split control visible:

Dim sec As Section
For Each sec In Split.Sections
    sec.Visible = True
Next sec
Split.Visible = True


Invisible Event

Occurs after all sections have been made invisible by the user and therefore the Split control has become invisible as well.

Syntax

Private Sub Split_Invisible()

Remarks

You can use the following code to make the Split control and all of its sections visible:

Dim sec As Section
For Each sec In Split.Sections
    sec.Visible = True
Next sec
Split.Visible = True


ReArrange Event

Occurs when the size of the Split control or sections has changed or when the Split control has become visible.

Syntax

Private Sub Split_ReArrange(ByVal ReArrangeType As splReArrangeType)

The ReArrange event syntax has these parts:

Part | Description
Split | A Split control.
ReArrangeType | An enum indicating the cause of the ReArrange event as described in Settings.

Settings

The settings for ReArangeType are:

Constant | Setting | Description
splNormal | 0 | The Split control has become visible or the size of the container has changed (and therefore the available area to display the sections). You have to recalculate and adjust the size of the sections.
splUserInternal | 1 | The user has changed the size of the sections with the help of the mouse.
splUserExternal | 2 | The user has changed the size of the Split control with the help of the mouse.

Remarks

Use the ReArrange event to adjust the size of the sections if ReArrangeType = splNormal. The ClientSize property of the Split control returns the area available to display the sections. The CountVisible property returns the number of visible sections. In the simplest case you can divide the available area by the number of visible sections and assign this value to the Size property of each Section object:

Private Sub Split_ReArrange(ByVal ReArrangeType As splReArrangeType)
Dim Sec As Section
Dim SectionNumber As Long
Dim SizeH As Single

If ReArrangeType = splReArrangeType.splNormal Then
With Split
SectionNumber = .Sections.CountVisible
If SectionNumber = 0 Then Exit Sub
SizeH = .ClientSize / SectionNumber
For Each Sec In .Sections
If Sec.Visible Then
Sec.Size = SizeH
Next Sec
.Refresh
End With
End If

End Sub

The ReArrange event can also be used to manually arrange the controls that are placed on the Split control and\or shall fill out the free region on the container. If you don't want the controls to be arranged automatically by the Split control, you can use the ScaleLeft, ScaleTop, ScaleWidth and ScaleHeight properties of the Section objects. In the simplest case it could look like this:

 If ReArrangeType = splReArrangeType.splNormal Then
    'Recalculation of the sections' size...
 End If

'Manuel alignment of a TreeView placed on the Split control:
 With Split.Sections(1)
   TreeView1.Move .ScaleLeft, .ScaleTop, .ScaleWidth, .ScaleHeight
   TreeView1.Visible = .Visible
 End With

'Manuel alignment of a ListView placed on the same Form
'as the Split control. Repeat the following code in the
'Resize event handler of the Form:
If Me.ScaleWidth >= Split.Width then
   ListView1.Move Split.Width, 0, Me.ScaleWidth - Split.Width, Me.ScaleHeight
End If

Note that normally there should be no reason for arranging the controls manually.


ShowHeadMenu Event

Occurs when the user clicks the region of a section's head used to show a menu.

Syntax

Private Sub Split_ShowHeadMenu(Sec As chSplitter.Section, ByVal X As Long, ByVal Y As Long)

The ShowHeadMenu event syntax has these parts:

Part | Description
Split | A Split control.
Sec | A reference to the Section object whose menu should be displayed.
X, Y | A number that specifies the location where the menu should be displayed. The X and Y values are always expressed in pixels.

Remarks

When this event occurs you should display the menu, which is specified in the HeadMenu property of the Section object, using the PopupMenu method. Thereby you can also specify a default menu (bold face). Note, however, that the coordinates are specified in pixels while the PopupMenu method expects the scale unit of the Form\UserControl. That's why you have to convert the values to the correct scale unit before using them:

In Forms\UserControls:

Private Sub Split_ShowHeadMenu(Sec As chSplitter.Section, ByVal X As Long, ByVal Y As Long)
 PopupMenu Sec.HeadMenu, , ScaleX(X, vbPixels, ScaleMode), ScaleY(Y, vbPixels, ScaleMode)
End Sub

In MDIForms:

Private Sub Split_ShowHeadMenu(Sec As chSplitter.Section, ByVal X As Long, ByVal Y As Long)
 PopupMenu Sec.HeadMenu, , X * Screen.TwipsPerPixelX, Y * Screen.TwipsPerPixelY
End Sub


Count Property

Returns the number of Section objects in a Split control's Sections collection.

Read only.

Syntax

Sections.Count

Sections refers to a Sections collection of a Split control.

Remarks

If you only want to get the number of the visible sections, you can use the CountVisible property instead.


CountVisible Property

Returns the number of visible Section objects in a Split control's Sections collection.

Read only.

Syntax

Sections.CountVisible

Sections refers to a Sections collection of a Split control.

Remarks

The number of the visible sections is significant if all sections shall be equal in size. In this case you have to divide the available area (ClientSize property) by the number of visible sections and assign this value to the Size property of each Section object.


Add Method

Adds a Section object to a Split control's Sections collection.

Syntax

Sections.Add(Key as String, [HeadText as String = ""], [HeadHeight], [ContainedControl as Object])

The Add method syntax has these parts:

Part | Description
Sections | The Split control's Sections collection.
Key | Required. A unique string that can be used to retrieve the Section object with the Item method.
HeadText | Optional. The string that appears in the section's head if HeadHeight > 0.
HeadHeight | Optional. The height of the section's head. The default value is 22 pixels.
ContainedControl | Optional. A control that will automatically be adjusted to the section's client area. Skip this parameter if you want to manually adjust the controls placed on the Split control.

Remarks

The Sections collection is a 1-based collection.

If you try to add a Section object to the Sections collection by specifying a key that is already identifying another section, you will get the runtime error 457 "This key is already associated with an element of this collection".

Because the Add method returns a reference to the newly created Section object, it is most convenient to set properties of the new Section object using this reference.

You have to invoke the Split control's Refresh method for the changes to take effect. Note that it is necessary to adjust the size (Size property) of the newly created section and all visible sections before calling the Refresh method (usually the sum of all visible sections' sizes should be equal to the ClientSize property of the Split control).


Clear Method

Removes all Section objects in the Sections collection.

Syntax

Sections.Clear

Sections refers to a Sections collection of a Split control.

Remarks

Use the Remove method if you only want to remove one section in the Sections collection.


Remove Method

Removes a specific Section object from the Split control's Sections collection.

Syntax

Sections.Remove Index

The Remove method syntax has these parts:

Part | Description
Sections | The Split control's Sections collection.
Index | Required. An integer or string that uniquely identifies the object within the Sections collection. If it is a numeric expression, Index has to be between 1 and the value returned by the Count property of the Sections collection. If it is a string, Index must specify the value of the Key property.

Remarks

The Sections collection is a 1-based collection.

If Index does not refer to an existing Section object in the Sections collection, you will get the runtime error 5 "Invalid procedure call or argument" or the runtime error 9 "Subscript out of range".

You have to invoke the Split control's Refresh method for the changes to take effect. Note that it is necessary to adjust the size (Size property) of the remaining sections before calling the Refresh method (usually the sum of all visible sections' sizes should be equal to the ClientSize property of the Split control).


ContainedControl Property

Returns or sets the control that fills out the client are of a section.

Syntax

Section.ContainedControl

Set Section.ContainedControl = Control

Section refers to a Section object in the Split control's Sections collection.

Remarks

Control has to be situated on the Split control. If not, the runtime error 380 "Invalid property value" is raised.

If you change this property, you have to invoke the Split control's Refresh method for the change to take effect.


CrossVisible Property

Returns or sets a value that specifies if a cross is displayed in the section's head so that the section can be clicked away by the user.

Syntax

Section.CrossVisible [= boolean]

Section refers to a Section object in the Split control's Sections collection.

Settings

The settings for boolean are:

Setting | Description
True | (Default) A cross is displayed in the section's head. The section can be clicked away by the user.
False | No cross is displayed. The section can not be clicked away.

Remarks

If you change this property, you have to invoke the Split control's Refresh method for the change to take effect.


HeadFont Property

Returns a reference to a Font object.

Syntax

Section.HeadFont

Section refers to a Section object in the Split control's Sections collection.

Remarks

Use the HeadFont property to get a reference to the Font object that defines the font style of the section's head. The following code, for example, demonstrates how to change the font sytle of the text that is displayed in the head of the first section:

Split.Sections(1).HeadFont.Bold = True
Split.Refresh

You have to invoke the Split control's Refresh method for the changes on the Font object returned by the HeadFont property to take effect.


HeadForeColor Property

Returns or sets the fore color (used to display text) of a section's head.

Syntax

Section.HeadForeColor [= Color]

The HeadForeColor property syntax has these parts:

Part | Description
Section | A Section object in the Split control's Sections collection.
Color | A value or constant that defines the fore color of the section.

Remarks

You can use the following code to change the fore color in the head of the first section to red:

Split.Sections(1).HeadForeColor = vbRed
Split.Refresh

If you change this property, you have to invoke the Split control's Refresh method for the change to take effect.


HeadHeight Property

Returns or sets the height of the section's head.

Syntax

Section.HeadHeight [= Number]

Section refers to a Section object in the Split control's Sections collection.

Remarks

The default value is 22 pixels.

The scale unit of the Split control's container is used.

If you change this property, you have to invoke the Split control's Refresh method for the change to take effect.

If a Split control is aligned vertically, the minimum size (height) of a section is defined by the height of its head.


HeadMenu Property

Returns or sets the menu that is displayed when the user clicks the appropriate area in the section's head.

Syntax

Section.HeadMenu

Set Section.HeadMenu = menu

The HeadMenu property syntax has these parts:

Part | Description
Section | A Section object in the Split control's Sections collection that you want a menu to be associated with.
menu | A menu that will be displayed when the user clicks the appropriate area in the section's head.

Remarks

If the HeadMenu property is not set to Nothing, a small triangle is displayed at the right of the head's caption to indicate that the menu is available.

If a menu is associated with a section and the user clicks the appropriate area in the head of this section, the ShowHeadMenu event is raised.

If you change this property, you have to invoke the Split control's Refresh method for the change to take effect.


HeadText Property

Returns or sets the text that is displayed in the section's head.

Syntax

Section.HeadText [= text]

The HeadText property syntax has these parts:

Part | Description
Section | A Section object in the Split control's Sections collection.
text | The text that is displayed in the section's head.

Remarks

If you change this property, you have to invoke the Split control's Refresh method for the change to take effect.


Key Property

Returns or sets a string that uniquely identifies a Section object in the Split control's Sections collection.

Syntax

Section.Key [= string]

The Key property syntax has these parts:

Part | Description
Section | A Section object in the Split control's Sections collection.
string | A string that uniquely identifies a Section object in the Split control's Sections collection.

Remarks

If string is not uniquely, the runtime error 457 "This key is already associated with an element of this collection" is raised.

You can specify the Key property when adding a Section object to the Split control's Sections collection using the Add method.


ScaleLeft, ScaleTop Properties (Section Object)

Return the horizontal (ScaleLeft) and vertical (ScaleTop) coordinates for the left and top edges of the section's client area.

Read only.

Syntax

Section.ScaleLeft

Section.ScaleTop

Section refers to a Section object in the Split control's Sections collection.

Remarks

These properties are always specified in twips.

Using the Split control these properties are needed if you want to manually adjust the controls placed on the Split control.


ScaleHeight, ScaleWidth Properties (Section Object)

Return the number of units for the vertical (ScaleHeight) and horizontal (ScaleWidth) measurement of the section's interior that is available for the controls.

Read only.

Syntax

Section.ScaleHeight

Section.ScaleWidth

Section refers to a Section object in the Split control's Sections collection.

Remarks

These properties are always specified in twips.

Using the Split control these properties are needed if you want to manually adjust the controls placed on the Split control.


Size Property

Returns or sets the size (equal to height if Split control is vertically aligned or width if Split control is horizontally aligned) that is used to display the section's head and the associated control (ContainedControl property).

Syntax

Section.Size [= number]

Section refers to a Section object in the Split control's Sections collection.

Remarks

The scale unit of the Split control's container is used.

If you change this property, you have to invoke the Split control's Refresh method for the change to take effect.

Note that when changing the size of one section, it is necessary to also adjust the size of the remaining sections because usually the sum of all visible sections' sizes should be equal to the ClientSize property of the Split control.

If a Split control is aligned vertically, the minimum size (height) of a section is defined by the height of its head (HeadHeight property).


Events

Events of the Split Control

ClickAway

Invisible

ReArrange

ShowHeadMenu


Properties

Properties of the Split Control

InnerBorderSize

InnerResizeDirect

MarginOppositeResize

MarginVBottomHRight

MarginVTopHLeft

MaxSizeByUser

MinSizeByUser

OuterControl

OuterResizeDirect

ResizeBorderSize

ScaleLeft

ScaleTop

ScaleHeight

ScaleWidth

ClientSize

Sections

Resizeable

VerticalIfNoAlign