Set caption to a PictureBox
Set caption to a PictureBox
Rate Set caption to a PictureBox
(1(1 Vote))
'SetPicCapt: Set caption to a picbox
'You must set the Font properties from the PicBox Properties
'This code will work with forms too(If an error just Modify)
Sub SetPicCapt(DestObject As PictureBox, ByVal Caption As String)
Dim intX As Integer, intY As Integer, IntWidth As Integer, IntHeight As Integer
DestObject.AutoRedraw = True
IntWidth = DestObject.TextWidth(Caption)
IntHeight = DestObject.TextHeight(Caption)
intX = DestObject.Width / 2 - IntWidth / 2
intY = DestObject.Height / 2 - IntHeight / 2
DestObject.CurrentX = intX
DestObject.CurrentY = intY
DestObject.Print Trim$(Caption)
End Sub
Set caption to a PictureBox Comments
No comments yet — be the first to post one!
Post a Comment