Allows you to make a frame border from a shape control. The frame border will be similar with Windows XP frame. The frame cannot contain any
API Declarations
Dim CX%, CY%, Color As Long, SvFont$, SvFSize%
Dim SvB As Boolean, SvI As Boolean, SvU As Boolean
With CX_Obj
CX = .CurrentX: CY = .CurrentY: Color = .ForeColor
SvFont = .FontName: SvFSize = .FontSize
SvB = .FontBold: SvI = .FontItalic: SvU = .FontUnderline
End With
'Settings have been saved
FrameRef.Visible = False
If CapWidth > FrameRef.Width - 240 Then CapWidth = 240
With FrameRef
'Top 1st border
CX_Obj.Line (.Left + 30, .Top)-(.Left + 90, .Top), &HBFD0D0, B
'Top 2nd border
CX_Obj.Line (.Left + 120 + CapWidth + 60, .Top)-(.Width + .Left - 45, .Top), &HBFD0D0, B
'Print caption
CXSetPos CX_Obj, .Left + 150, .Top - 90: CX_Obj.ForeColor = &HD54600
CXSetFont CX_Obj, "Tahoma", 8, False, False, False
CX_Obj.Print Caption
'Left border
CX_Obj.Line (.Left, .Top + 30)-(.Left, .Top + .Height - 45), &HBFD0D0, B
'Right border
CX_Obj.Line (.Left + .Width - 15, .Top + 30)-(.Left + .Width - 15, .Top + .Height - 45), &HBFD0D0, B
'Bottom border
CX_Obj.Line (.Left + 30, .Top + .Height - 15)-(.Left + .Width - 45, .Top + .Height - 15), &HBFD0D0, B
'Create Left-Up Corner
CX_Obj.Line (.Left, .Top + 30)-(.Left + 30, .Top), &HBFD0D0
CX_Obj.Line (.Left, .Top + 45)-(.Left + 45, .Top), &HBFD0D0
'Create Right-Up Corner
CX_Obj.Line (.Left + .Width - 45, .Top)-(.Left + .Width, .Top + 45), &HBFD0D0
CX_Obj.Line (.Left + .Width - 60, .Top)-(.Left + .Width, .Top + 60), &HBFD0D0
'Create Right-Down Corner
CX_Obj.Line (.Left + .Width - 45, .Top + .Height - 15)-(.Left + .Width, .Top + .Height - 60), &HBFD0D0
CX_Obj.Line (.Left + .Width - 60, .Top + .Height - 15)-(.Left + .Width, .Top + .Height - 60), &HBFD0D0
'Create Left-Down Corner
CX_Obj.Line (.Left, .Top + .Height - 45)-(.Left + 30, .Top + .Height - 15), &HBFD0D0
CX_Obj.Line (.Left, .Top + .Height - 60)-(.Left + 45, .Top + .Height - 15), &HBFD0D0
End With
'Restore settings
With CX_Obj
.CurrentX = CX: .CurrentY = CY: .ForeColor = Color
.FontName = SvFont: .FontSize = SvFSize
.FontBold = SvB: .FontItalic = SvI: .FontUnderline = SvU
End With
End Sub