Dim x As Object For Each x In Me.Controls MsgBox x.Name Next
Dim x As Object For Each x In Form1.Controls MsgBox TypeName(x) Next
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim x As Object Dim i As Integer Dim n1 As Integer Dim n2 As Integer Dim Lx As Long On Error Resume Next For Each x In Form1.Controls n1 0: n2 0 For i = 0 To SSTab1.Tabs SSTab1.Tab = i Lx = x.Left If Lx < 0 Then n1 n1 + 1 Else n2 i + 1 Next If n1 > 0 And n2 > 0 Then MsgBox x.Name & " onglet=" & n2 - 1 End If Next
Option Explicit Dim Xl(10) As Integer Dim Xt(10) As Integer Dim Xw(10) As Integer Dim Xh(10) As Integer Dim Sw As Integer Dim Sh As Integer Private Sub Form_Load() Dim x As Object Dim i As Integer Sw = Form1.ScaleWidth Sh = Form1.ScaleHeight On Error GoTo 10 For Each x In Form1.Controls i = i + 1 If x.Left < 0 Then Xl(i) x.Left + 75000 Else Xl(i) x.Left Xt(i) = x.Top Xw(i) = x.Width Xh(i) = x.Height 10 Next End Sub Private Sub Form_Resize() Dim x As Object Dim i As Integer Dim Tw As Single Dim Th As Single Tw = Form1.ScaleWidth / Sw Th = Form1.ScaleHeight / Sh On Error GoTo 10 For Each x In Form1.Controls i = i + 1 If x.Left < 0 Then x.Left = Xl(i) * Tw - 75000 Else x.Left = Xl(i) * Tw End If x.Top = Xt(i) * Th x.Width = Xw(i) * Tw x.Height = Xh(i) * Th 10 Next End Sub