cs_aurel16
Messages postés75Date d'inscriptionsamedi 17 septembre 2005StatutMembreDernière intervention29 octobre 2010
-
25 janv. 2009 à 21:38
cs_aurel16
Messages postés75Date d'inscriptionsamedi 17 septembre 2005StatutMembreDernière intervention29 octobre 2010
-
26 janv. 2009 à 14:54
Bonjour,
Je voudrais arrondir les deux angles du bas d'un tabcontrol. Mais je ne sais pas dutout comment procéder. J'ai regardé vers form.designer mais je ne trouve rien permettant de modifier cela.
cs_aurel16
Messages postés75Date d'inscriptionsamedi 17 septembre 2005StatutMembreDernière intervention29 octobre 2010 26 janv. 2009 à 14:54
Bonjour,
Je te remercie [auteur/NHERVAGAULT/84425.aspx nhervagault], mais j'ai réussi grâce à cette méthode :
<System.Runtime.InteropServices.DllImportAttribute("gdi32.dll", SetLastError:=True)>
Private Function CreateRoundRectRgn(ByVal X1 As Int32, ByVal Y1 As Int32, ByVal X2 As Int32, ByVal Y2 As Int32, ByVal X3 As Int32, ByVal Y3 As Int32) As IntPtr
End Function
<System.Runtime.InteropServices.DllImportAttribute("gdi32.dll", SetLastError:=True)> Private Function DeleteObject(ByVal hObject As IntPtr) As Int32
End Function
<System.Runtime.InteropServices.DllImportAttribute("user32.dll", SetLastError:=True)> Private Function SetWindowRgn(ByVal hwnd As IntPtr, ByVal hRgn As IntPtr, ByVal bRedraw As Boolean) As Int32
End Function
Public Sub RoundCorners(ByRef tabcontrol As System.Windows.Forms.Form, Optional ByVal Angle As System.Byte = 15)
With tabcontrol
Dim lRet As IntPtr = CreateRoundRectRgn(0, 0, .Width, .Height, Angle, Angle)
SetWindowRgn(.Handle, lRet, True)
DeleteObject(lRet)
End With
End Sub
mais cela efface la bordure du tabcontrol, comment faire pour la refaire apparaitre ?