Public Sub AJouterControl(strType As String, strNom As String, _ intH As Integer, intL As Integer, intPosX As Integer, _ intPosY As Integer, frm As Form, ByVal strTexte As String, _ intAlign As Integer, Optional conteneur As String = "tabScenario", _ Optional intFontSize As Integer = 8, _ Optional blnBold As Boolean False, Optional strBg As String &H8000000F) Dim nouveauControl As Control Dim strTest As String 'Comme je travail avec des frames et des sstabs, je met un 3ieme argurment 'À mon crontols.Add. Si c'est pour l'ajouter dans une form sans conteneur 'Ne met pas de troisième argument. Set nouveauControl = frm.Controls.Add("VB." & strType, strNom & nbControlesCréés, frm.Controls(conteneur)) With nouveauControl .Visible = True .Left = intPosX .Top = intPosY .Height = intH .Width = intL .Caption = strTexte .Alignment = intAlign .FontSize = intFontSize .FontBold = blnBold .BackColor = strBg End With nbControlesCréés = nbControlesCréés + 1 End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question