http://www.recursosvisualbasic.com.ar/htm/trucos-codigofuente-visual-basic/56.htm
Código:
Option Explicit
' Crea la región
Private Declare Function CreateRoundRectRgn Lib "gdi32" ( _
ByVal X1 As Long, _
ByVal Y1 As Long, _
ByVal X2 As Long, _
ByVal Y2 As Long, _
ByVal X3 As Long, _
ByVal Y3 As Long) As Long
'Establece la región
Private Declare Function SetWindowRgn Lib "user32" ( _
ByVal hwnd As Long, _
ByVal hRgn As Long, _
ByVal bRedraw As Boolean) As Long
Private Sub Form_Load()
Call Redondear_objetivo(Picture1, 15)
Picture1.BackColor = vbRed
End Sub
Private Sub Redondear_objetivo(objetivo As PictureBox, Radio As Long)
Dim Region As Long
Dim ret As Long
Dim Ancho As Long
Dim Alto As Long
'Obtenemos el ancho y alto de la region del Form
Ancho = objetivo.Width / Screen.TwipsPerPixelX
Alto = objetivo.Height / Screen.TwipsPerPixelY
'Le pasamos el ancho alto del formualrio y el valor de _
redondeo es decir el radio
Region = CreateRoundRectRgn(0, 0, Ancho, Alto, Radio, Radio)
' Aplica la región al formulario
ret = SetWindowRgn(objetivo.hwnd, Region, True)
End Sub
S2