I'm currently working on a personal project to aid myself in honing my programming skills.
In this project, there are a number of different command buttons on a number of different forms.
For purely aesthetic reasons, I'd like to change the shape of the command buttons from the default rectangular, to say, an oval.
Is there a way to accomplish this through standard VB code?
I understand that shapes can be drawn and can simulate command buttons via the various *mouse events, but I'd prefer to stay away from doing that way if it's at all possible.
Oh, yes, and you need to draw on the buttons anyway.
SetWindowRgn merely causes NOTHING to happen when the mouse (or some other rodent) clickes on the "GREY" edge. The best way to do it is to use BitBlt to draw "IMAGES" of round buttons or to use the Ellipse API.
MicroBasic Dragon Shadow Trainer
There is no good or evil in the world...only programmers and fools .
maybe if you change the height and width of the button in a special pattern at the right speed it would look like a round button or you can go to you r local drug dealer and buy some shroomz, then you can change the shape of anything!
Option Explicit
'//WIN32API Declare
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) _
As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Private Sub Command1_Click()
MsgBox "Bingo"
End Sub
Private Sub Form_Load()
Dim hRgn As Long
With Command1
hRgn = CreateEllipticRgn(10, 10, 180, 100)
SetWindowRgn .hwnd, hRgn, True
End With
End Sub
'Code improved by vBulletin Tool (Save as...)