Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

...What About "Odd Shaped" Buttons In VB...

Status
Not open for further replies.

CubeE101

Programmer
Nov 19, 2002
1,492
US
This is a continuation of the other thread on Odd Shaped Windows...
thread222-444672

How Do You Create Odd Shaped Buttons in VB...

Do You Need to create additional controls or is there something similar to:
Option Explicit
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 Boolean) As Long

Private Sub Form_Load()
SetWindowRgn Me.hWnd, CreateEllipticRgn(0, -1, 532, 322), True
End Sub

...that you can use for buttons also (or even the same code modified?)

Also...
is there a contents listing of the gdi32.DLL ? Sometimes... the BASIC things in life are the best...
cheers.gif

or at least the most fun ;-)
-Josh Stribling
 
Cool...
Using the methods from: Thread222-444672

Command1.Width = 16
Command1.Height = 16
SetWindowRgn Command1.hWnd, CreateEllipticRgn(0, 0, 16, 16), True
Sometimes... the BASIC things in life are the best...
cheers.gif

or at least the most fun ;-)
-Josh Stribling
 
Does anyone know how to remove the normal button functions from a button...

1) I set the Style to Flat from 3D and nothing changed...

2) How do you remove the dashed box from a selected button?

3) is there a way to disable the button from moving down and right when pressed?

Code:
-Thnx-
 Josh
Sometimes... the BASIC things in life are the best...
cheers.gif

or at least the most fun ;-)
-Josh Stribling
 
Never Mind... (Duh)
[hammer]
You can use a PictureBox instead of a command button... Sometimes... the BASIC things in life are the best...
cheers.gif

or at least the most fun ;-)
-Josh Stribling
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top