How To make Flat Buttons in your programs

Hey, I found this in the vb source site, it gives your programs buttons a flatten looks, kool some peopel ask me about this cause i being using it on my latest proggies here you go

First make a module with this code

Option Explicit

'to use the subroutine, you have to put a picturebox named picFlat
'on each form from where you will call this sub
'pictureboxe's properties should be: Index=0, Appearance = Flat,
'BorderStyle=fixed single, Visible=False

Public Sub MakeFlatButtons(frm As Form)
Dim ButtonCount As Integer
Dim c As Control
On Error Resume Next

For Each c In frm
If TypeOf c Is CommandButton Then

ButtonCount = ButtonCount + 1

Load frm.picFlat(ButtonCount)
With frm.picFlat(ButtonCount)
.Visible = True
.Left = c.Left
.Top = c.Top
.Width = c.Width
.Height = c.Height
End With

Set c.Container = frm.picFlat(ButtonCount)
c.Left = 0
c.Top = 0
End If
Next c

End Sub

Follow the steps that he tells on the top of the module then on your form put this

Private Sub Form_Load()
Call MakeFlatButtons(Me)
End Sub

Thas all folk, 😈

5 thoughts on “How To make Flat Buttons in your programs

  1. OK LOCO THE CODE WONT WORK UNTI U PUT SOME EXTRA IN IT..
    WICH IS GONNA MAKE THE FORM TO APPEAR….
    TRY THIS AND ULL SEE IT WORKIN…… 🙂


    Private Sub Form_Load()
    Call MakeFlatButtons(Me)
    Me.Show ' SHOWS THE FORM WINDOW... TO SEE THE RESULTZ
    End Sub
  2. Just get like KewlBottonz.ocx and put it in your system32 and then load the KewlBottonz.ocx to your Components for vb6 that you should be able to figure the rest out thats what my anti-ban uses is a ocx kinda like KewlBottonz 😉

  3. 😆 jeje Did you change the properties in the picturebox 🙂 it works for me, check this is the original code

    I still wanna use sp buttons, jeje 😉

Leave a Reply

You must Register or Login to comment on How To make Flat Buttons in your programs