VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Makes command button control transparent with the form background picture.

Ali Atiq  (5 Submissions)   Custom Controls/Forms/Menus   Visual Basic 5.0   Unknown Difficulty   Mon 16th June 2003   Mon 8th February 2021

Makes command button control transparent with the form background picture.

API Declarations



Option Explicit

Public Function MakeButtonsTransparent(frm As Form)
Dim ctl As Control
Static StartupFlag%
On Error GoTo MakeCommandTransparen_ErrHandler
If StartupFlag% > 0 Then Exit Function
frm.Controls.Add "VB.PictureBox", "tmpPic", frm
With frm!tmpPic
.AutoRedraw = True
For Each ctl In frm.Controls
If TypeOf ctl Is CommandButton Then
.BorderStyle = 0
.Visible = True ' this one also
.Cls
.Move ctl.Left, ctl.Top, ctl.Width, ctl.Height
.CurrentX = (.ScaleWidth / 2) - (frm.TextWidth(ctl.Caption) / 2)
.CurrentY = (.ScaleHeight / 2) - (frm.TextHeight(ctl.Caption) / 2)
.PaintPicture frm.Image, 0, 0, , , .Left, .Top
frm!tmpPic.Print ctl.Caption
ctl.Picture = .Image
ctl.Caption = ""
End If
Next ctl
.Visible = False
End With
StartupFlag% = StartupFlag% + 1

Exit Function
MakeCommandTransparen_ErrHandler:
frm!tmpPic.Visible = False
StartupFlag% = StartupFlag% + 1
MsgBox Err.Description
End Function


Rate Makes command button control transparent with the form background picture. (1(1 Vote))
Makes command button control transparent with the form background picture..bas

Makes command button control transparent with the form background picture. Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters