VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Allows you to make a frame border from a shape control. The frame border will be similar with Windo

by Brandalls (1 Submission)
Category: Graphics
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Thu 18th July 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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

Rate Allows you to make a frame border from a shape control. The frame border will be similar with Windo



' 2.Put these lines of code to the Form_Load procedure.
'
'
' Arg: CXMakeFrame (Objects supporting LINE), (Caption width), (Caption), (Shape control)
CXMakeFrame Me, 1020, "FeLuna Frame", Shape1

'that code will create a frame like Windows XP frame.
'be sure to turn on the AutoRedraw function.
'
'work together with Audrey

Download this snippet    Add to My Saved Code

Allows you to make a frame border from a shape control. The frame border will be similar with Windo Comments

No comments have been posted about Allows you to make a frame border from a shape control. The frame border will be similar with Windo. Why not be the first to post a comment about Allows you to make a frame border from a shape control. The frame border will be similar with Windo.

Post your comment

Subject:
Message:
0/1000 characters