Dim Obj As Object Dim Index As String Screen.MousePointer = 11 Open App.Path & "\ListaOggetti.txt" For Output As #1 On Error Resume Next Print #1, "me.Height = " & Me.Height Print #1, "me.Left = " & Me.left Print #1, "me.top = " & Me.top Print #1, "me.Width = " & Me.width Print #1, "" Dim MyControlli() As Variant Dim M As Long M = Me.Controls.Count - 1 ReDim MyControlli(M, 7) Dim COnta As Long For Each Obj In Me If TypeOf Obj Is TextBox Then MyControlli(COnta, 1) = "TextBox" ElseIf TypeOf Obj Is Timer Then MyControlli(COnta, 1) = "TextBox" ElseIf TypeOf Obj Is Label Then MyControlli(COnta, 1) = "Label" ElseIf TypeOf Obj Is StatusBar Then MyControlli(COnta, 1) = "StatusBar" ElseIf TypeOf Obj Is SSTab Then MyControlli(COnta, 1) = "SSTab" ElseIf TypeOf Obj Is Frame Then MyControlli(COnta, 1) = "Frame" ElseIf TypeOf Obj Is PictureBox Then MyControlli(COnta, 1) = "PictureBox" ElseIf TypeOf Obj Is CommandButton Then MyControlli(COnta, 1) = "CommandButton" ElseIf TypeOf Obj Is CommandButton Then MyControlli(COnta, 1) = "CommandButton" ElseIf TypeOf Obj Is ProgressBar Then MyControlli(COnta, 1) = "ProgressBar" ElseIf TypeOf Obj Is ComboBox Then MyControlli(COnta, 1) = "ComboBox" ElseIf TypeOf Obj Is Image Then MyControlli(COnta, 1) = "Image" ElseIf TypeOf Obj Is VB.Menu Then MyControlli(COnta, 1) = "Menu" ElseIf TypeOf Obj Is CheckBox Then MyControlli(COnta, 1) = "CheckBox" ElseIf TypeOf Obj Is DirListBox Then MyControlli(COnta, 1) = "DirListBox" ElseIf TypeOf Obj Is FileListBox Then MyControlli(COnta, 1) = "FileListBox" ElseIf TypeOf Obj Is CommonDialog Then MyControlli(COnta, 1) = "CommonDialog" Else MyControlli(COnta, 1) = "Z_AltroTipo" End If Index = "(" & Obj.Index & ")" If Err.Number <> 0 Then Index = "" Err.Clear End If MyControlli(COnta, 2) = Obj.Name ' Nome MyControlli(COnta, 3) = Obj.Height MyControlli(COnta, 4) = Obj.left MyControlli(COnta, 5) = Obj.top MyControlli(COnta, 6) = Obj.width MyControlli(COnta, 7) = Index COnta = COnta + 1 Next '****************************************************************************** ' DEVI INSERIRE PER FORZA UN cOMBObOX '****************************************************************************** MyCombo1.Clear For COnta = 0 To UBound(MyControlli) - 1 MyCombo1.AddItem MyControlli(COnta, 1) & "|" & MyControlli(COnta, 2) & "|" & MyControlli(COnta, 3) & "|" & MyControlli(COnta, 4) & "|" & MyControlli(COnta, 5) & "|" & MyControlli(COnta, 6) & "|" & MyControlli(COnta, 7) Next MyCombo1.Refresh Dim Tipo, MNome, MHeight, Mleft, Mtop, Mwidth, Mindice As String Dim C As Long For COnta = 0 To MyCombo1.ListCount - 1 Stringa = MyCombo1.List(COnta) Debug.Print Stringa C = InStr(1, Stringa, "|") ' tipo Tipo = "'Controllo tipo " & Mid(Stringa, 1, C - 1) Stringa = Mid(Stringa, C + 1, Len(Stringa)) ' Nome C = InStr(1, Stringa, "|") MNome = Mid(Stringa, 1, C - 1) Stringa = Mid(Stringa, C + 1, Len(Stringa)) If Stringa = "||||" Then MHeight = "" Mleft = "" Mtop = "" Mwidth = "" Mindice = "" GoTo FineLoop End If ' Height C = InStr(1, Stringa, "|") MHeight = Mid(Stringa, 1, C - 1) Stringa = Mid(Stringa, C + 1, Len(Stringa)) ' left C = InStr(1, Stringa, "|") Mleft = Mid(Stringa, 1, C - 1) Stringa = Mid(Stringa, C + 1, Len(Stringa)) ' top C = InStr(1, Stringa, "|") Mtop = Mid(Stringa, 1, C - 1) Stringa = Mid(Stringa, C + 1, Len(Stringa)) ' Mwidth C = InStr(1, Stringa, "|") Mwidth = Mid(Stringa, 1, C - 1) Stringa = Mid(Stringa, C + 1, Len(Stringa)) Mindice = Stringa FineLoop: Print #1, Tipo & " - " & MNome & Mindice Print #1, "'***************************************************" If Len(Trim(Mleft)) > 0 Then Print #1, MNome & Mindice & ".Height = " & MHeight Print #1, MNome & Mindice & ".Left = " & Mleft Print #1, MNome & Mindice & ".top = " & Mtop Print #1, MNome & Mindice & ".Width = " & Mwidth End If Print #1, "" Next Close #1 shell "Notepad.exe " & App.Path & "\ListaOggetti.txt", vbMaximizedFocus Screen.MousePointer = 0 |