Welcome
Contents of ctFrame

  The ctFrame provides a simple method for creating boxes or container objects.

This controls makes it very simple to create boxes, title bars, or container objects with a variety of different border effects. The advantage of using this control is that it can save time by not having to create boxes or box effects with standard line objects.

Each frame object consists of an inner and outer border. The inner border can be hidden by not specifying any new values for its properties.

This object has been set up as an ISimpleFrame object. These means controls placed within the ctFrame object become children of the control. This can only occur in development languages that support ISimpleFrame.

File Names

Control File 	: CTFRAME.OCX

License File 	: ctFrame.lic

Class Name

CCtFrameCtrl

See Also :

Simulating a Transparent Effect

Events

Methods

Properties

ctFrame © 2001 Gamesman Inc. / DBI Technologies Inc.


Events

ctFrame Event	Occurs
Click	Standard Event
DblClick	Standard Event
MouseDown	Standard Event
MouseMove	Standard Event
MouseUp	Standard Event
Timer	Occurs when the internal timer is fired.


Methods

ctFrame Methods	Return Type	Description
StartTimer	integer	Starts the controls internal timer.
StopTimer	boolean	Stops the controls internal timer.


Properties

ctFrame Properties	Data Type	Description
BackColor	long	Specifies background color of the object.
BackImage	Picture	Specifies the bitmap or icon image used to tile the background of the control.
BorderColor	long	Specifies the border color of the control.
DistanceApart	integer	Specifies the distance between the InnerBorder and OuterBorder border.
DragBars	integer (enumerated)	Specifies the type of drag bars or vertical lines to be drawn on the left side of the control. Valid values include… • 0 - None • 1 - Single • 2 - Double
ImageXOffset	integer	Specifies the horizontal offset used to calculate the starting position of the BackImage property.
ImageYOffset	integer	Specifies the vertical offset used to calculate the starting position of the BackImage property.
InnerBorder	integer (enumerated)	Specifies the type of border style used for the inner border. Valid values include ... • 0 - Regular • 1 - None • 2 - Raised • 3 - Lowered • 4 - Drop Shadow • 5 - Inset
InnerWidth	integer	Specifies the width or thickness of the inner border.
OuterBorder	integer (enumerated)	Specifies the type of border style used for the outer border. Valid values include ... • 0 - Regular • 1 - None • 2 - Raised • 3 - Lowered • 4 - Drop Shadow • 5 - Inset
OuterWidth	integer	Specifies the width or thickness of the outer border.
ShadowColor	long	Specifies the color of the shadow border (drop shadow border type only )
ShowBottom	boolean	Specifies if the bottom side of the border will be drawn.
ShowLeft	boolean	Specifies if that left side of the border will be drawn.
ShowRight	boolean	Specifies if that right side of the border will be drawn.
ShowTop	boolean	Specifies if that top side of the border will be drawn.
TimerRate	integer	Specifies the amount of time (in milliseconds) between intervals where the Timer event is fired.


Simulating a Transparent Effect

While this control does not directly support transparency, it does contain the necessary properties required to simulate transparency. True transparency occurs when an image behind the control remains visible even though a control sits on top of it.

In this case, we are assuming that we are using an image assigned to a form and that we want this image to become part of the background of the control. To do this, we assign the same image as that assigned to the form to the BackImage property of the control. You then adjust the ImageXOffset and ImageYOffset properties so that image in the control lines up with the image assigned to host form. This can either be done at design time or at run time. For instance..

    Private Sub Form_Load()

        ctFrame.BackImage = Form1.Picture

        ctFrame.ImageXOffset = ctFrame.Left / Screen.TwipsPerPixelX

        ctFrame.ImageYOffset = ctFrame.Top / Screen.TwipsPerPixelY

    End Sub


BackColor
BackColor Property

Description

Determines the background color of the control.

Syntax

[form.]ctFrame.BackColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctFrame.BackColor = RGB( 128, 128, 128 )


BackImage
BackImage Property

Description

Specifies the bitmap or icon image used to tile the background of the control. If a bitmap or icon is specified for this property, the control will no longer be colored with the BackColor property.

In order to set the picture of the control, it must be either set using the picture property page of the control, the property table of the host language ( if available ), or by assigning a picture from another control to this one.

Syntax

[form.]ctFrame.BackImage [ = Picture ]

Data Type

Picture

Example

ctFrame.BackImage = OLE_Object.Picture


BorderColor
BorderColor Property

Description

Specifies the color of the border painted around the control.

Syntax

[form.]ctFrame.BorderColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctFrame.BorderColor = RGB( 128, 128, 128 )


DistanceApart
DistanceApart Property

Description

Specifies the distance between the InnerBorder and OuterBorder border.

Syntax

[form.]ctFrame.DistanceApart [ = setting% ]

Data Type

Integer

Example

ctFrame.DistanceApart = 10


DragBars
DragBars Property

Description

Specifies the type of drag bars or vertical lines to be drawn on the left side of the control. Valid values include…

•	0 - None

•	1 - Single

•	2 - Double

Syntax

[form.]ctFrame.DragBars [ = setting% ]

Data Type

Integer ( enumerated )

Example

ctFrame.DragBars = 1


ImageXOffset
ImageXOffset Property

Description

Specifies the horizontal offset used to calculate the starting position of the BackImage property.

Syntax

[form.]ctFrame.ImageXOffset [ = setting% ]

Data Type

Integer

Example

ctFrame.ImageXOffset = 1


ImageYOffset
ImageYOffset Property

Description

Specifies the vertical offset used to calculate the starting position of the BackImage property.

Syntax

[form.]ctFrame.ImageYOffset [ = setting% ]

Data Type

Integer

Example

ctFrame.ImageYOffset = 1


InnerBorder
InnerBorder Property

Description

Specifies the type of border style used for the inner border. Valid values include ...

•	0 - Regular	: Regular border

•	1 - None	: No border

•	2 - Raised	: Raised 3D border

•	3 - Lowered	: Lowered 3D border

•	4 - Drop Shadow	: Regular border with a shadow

•	5 - Inset      	: Inset border

Syntax

[form.]ctFrame.InnerBorder [ = setting% ]

Data Type

Integer ( enumerated )

Example

ctFrame.InnerBorder = 2


InnerWidth
InnerWidth Property

Description

Specifies the width or thickness of the inner border.

Syntax

[form.]ctFrame.InnerWidth [ = setting% ]

Data Type

Integer

Example

ctFrame.InnerWidth = 1


OuterBorder
OuterBorder Property

Description

Specifies the type of border style used for outer the border. Valid values include ...

•	0 - Regular	: Regular border

•	1 - None	: No border

•	2 - Raised	: Raised 3D border

•	3 - Lowered	: Lowered 3D border

•	4 - Drop Shadow	: Regular border with a shadow

•	5 - Inset      	: Inset border

Syntax

[form.]ctFrame.OuterBorder [ = setting% ]

Data Type

Integer ( enumerated )

Example

ctFrame.OuterBorder = 2


OuterWidth
OuterWidth Property

Description

Specifies the width or thickness of the outer border.

Syntax

[form.]ctFrame.OuterWidth [ = setting% ]

Data Type

Integer

Example

ctFrame.OuterWidth = 1


ShadowColor
ShadowColor Property

Description

Determines the color of the shadow in a drop shadow border.

Syntax

[form.]ctFrame.ShadowColor [ = color& ]

Data Type

Long ( OLE_COLOR )

Example

ctFrame.ShadowColor = RGB( 128, 128, 128 )


ShowBottom
ShowBottom Property

Description

Specifies if the bottom side of the border will be drawn.

Syntax

[form.]ctFrame.ShowBottom [ = { True | False } ]

Data Type

Boolean

Example

ctFrame.ShowBottom = TRUE


ShowLeft
ShowLeft Property

Description

Specifies if the left side of the border will be drawn.

Syntax

[form.]ctFrame.ShowLeft [ = { True | False } ]

Data Type

Boolean

Example

ctFrame.ShowLeft = TRUE


ShowRight
ShowRight Property

Description

Specifies if the right side of the border will be drawn.

Syntax

[form.]ctFrame.ShowRight [ = { True | False } ]

Data Type

Boolean

Example

ctFrame.ShowRight = TRUE


ShowTop
ShowTop Property

Description

Specifies if the top side of the border will be drawn.

Syntax

[form.]ctFrame.ShowTop [ = { True | False } ]

Data Type

Boolean

Example

ctFrame.ShowTop = TRUE


TimerRate
TimerRate Property

Description

Specifies the amount of time (in milliseconds) between intervals where the Timer event is fired.

Syntax

[form.]ctFrame.TimerRate [ = setting% ]

Data Type

Integer

Example

ctFrame.TimerRate = 5


StartTimer
StartTimer Method

Description

Start the controls internal timer.

Syntax

[form.]ctFrame.StartTimer

Return Type

Integer - The ID of the timer. 0 if the timer was not started.

Parameters

None

Example

ctFrame.StartTimer


StopTimer
StopTimer Method

Description

Stops the controls internal timer.

Syntax

[form.]ctFrame.StopTimer

Return Type

Boolean - True is the timer was stopped

Parameters

None

Example

ctFrame.StopTimer


Timer
Timer Event

Description

Occurs when the internal timer is fired.

Parameters

None