How To make Flat Buttons in your programs

You can talk about VB programming here

How To make Flat Buttons in your programs

Postby locohacker » Tue Dec 14, 2004 5:14 pm


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

Code: Select all
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

Code: Select all
Private Sub Form_Load()
Call MakeFlatButtons(Me)
End Sub


Thas all folk, :twisted:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4363
Joined: Fri Dec 31, 2004 6:59 pm

Postby Project SP » Tue Dec 14, 2004 11:00 pm

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...... :)

Code: Select all
Private Sub Form_Load()
Call MakeFlatButtons(Me)
Me.Show ' SHOWS THE FORM WINDOW... TO SEE THE RESULTZ
End Sub
User avatar
Project SP
imFiles Junior
imFiles Junior
 
Posts: 98
Joined: Wed Nov 24, 2004 11:32 pm
Location: LOCALHOST

Postby UDG Clan » Wed Dec 15, 2004 6:57 am

it does not do anytihng all it does is put the button on the top lol
UDG Clan
imFiles Senior
imFiles Senior
 
Posts: 230
Joined: Mon Nov 22, 2004 7:44 pm

Postby locohacker » Wed Dec 15, 2004 9:16 am

:lol: jeje Did you change the properties in the picturebox :) it works for me, check this is the original code

http://imfiles.com/source/A_function ... 242002.zip

I still wanna use sp buttons, jeje :wink:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4363
Joined: Fri Dec 31, 2004 6:59 pm

hmmm

Postby Guest » Wed Dec 15, 2004 1:03 pm

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 :wink:
Guest
 

Postby locohacker » Wed Dec 15, 2004 9:50 pm

Yo Syxx where u downlod that oxc at :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4363
Joined: Fri Dec 31, 2004 6:59 pm


Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests