CReio que exemplo pronto não há disponivel (pelo menos free). No site http://cheese.formice.com/forum/threads ... vb6.38327/ e postado um codigo para algumas formas (fala em VB6 mas e muito similar ao vba) (Achei algo tb aquii: http://www.vbarchiv.net/api/api_createpolygonrgn.html , mas é em alemão)
Então teriamos no modulo de declaraçãoAPI
Option Explicit
'Declarando constantes publicas
Public Const SWP_NOSIZE = &H1
Public Const SM_CYCAPTION = 4
Type POINTAPI
x As Long
y As Long
End Type
'Declarando funções API
Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long _
, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long _
, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long _
, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Declare Function GetSystemMetrics Lib "user32.dll" (ByVal nIndex As Long) As Long
Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
'E agora Temos que criar Formas customizadas:
'Cria uma janela poligonal
Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINT, _
ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
' Cria uma janela elíptica
Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, _
ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
' Cria uma janela retangula
Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, _
ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long)
' Cria uma janela retangular borda arredondas
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
'E Agora é óbvio que necessitamos de remover a forma:
Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
e abaixo cria no formulario com cantos arredondados
Option Explicit
Private Sub UserForm_Initialize()
Dim lngHwnd As Long, w As Long, h As Long
Dim lngTH As Long
Dim Ux, Uy As Single
Dim lngRgn As Long
Dim strClassName As String
strClassName = "ThunderDFrame"
lngTH = GetSystemMetrics(SM_CYCAPTION)
w = (Me.Width / 0.75) - 1
h = (Me.Height / 0.75) - 1
lngRgn = CreateRoundRectRgn(5, 5, w, h, 50, 50)
lngHwnd = FindWindow(strClassName, Me.Caption)
SetWindowRgn lngHwnd, lngRgn, True
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 05/04/2013 2:02 pm