
Originally Posted by
TupacShakur
But imagine doing this say for 6 frames within ur application (on different forms), well i might just quit programming in VB

!!!
You let VB do it for you.
here is a sub that will turn a picturebox in a reasonable frame look-a-like:
VB Code:
Private Sub Picture2Frame(ByRef oPic As PictureBox, ByVal sCaption As String, _
Optional ByVal lBorderColour As Long = &H8000000C, _
Optional ByVal lTextColour As Long = vbBlack, _
Optional ByVal oFont As StdFont)
Dim lbl As Label, lGap As Long
With oPic
.AutoRedraw = True
.BorderStyle = 0
.Appearance = 0
.ScaleMode = vbPixels
.BackColor = vbButtonFace
End With
Set lbl = Me.Controls.Add("VB.Label", "piclbl" & Me.Controls.Count)
With lbl
Set .Container = oPic
.AutoSize = True
.Caption = " " & sCaption & " "
.ForeColor = lTextColour
If Not oFont Is Nothing Then Set lbl.Font = oFont
lGap = .Height \ 2
.Left = 2 * lGap
.Top = 0
.Visible = True
End With
oPic.Line (lGap, lGap)-(oPic.ScaleWidth - lGap, oPic.ScaleHeight - lGap), lBorderColour, B
Set lbl = Nothing
Set oFont = Nothing
End Sub
So in the Form_Load you do:
VB Code:
Private Sub Form_Load()
Picture2Frame Picture1, "First Frame", , vbBlue
Picture2Frame Picture2, "Second Frame", vbBlack, vbRed
' or you can pass a font to use as well
With Picture3
.FontBold = True
.FontName = "Comic Sans MS"
.FontSize = 14
End With
Picture2Frame Picture3, "Third Frame", , , Picture3.Font
End Sub