jjs 发表于 2007-4-26 16:34:52

好,下一个问题。我不知道该怎么说,请原谅我。给定上面的pic形式,我可以枚举其中一个框架内的控件,并通过编号捕获选定的控件(考虑一个从零开始的枚举,得到选定的控件0-?)

jjs 发表于 2007-4-26 16:37:07

或者可能是一个数组...

jjs 发表于 2007-4-26 21:03:12

这可能会有所帮助,我记得自己也在纠结同样的事情,却忘记了答案。
据我所知,groupname比frames好。
Option Explicit
Private C As Control
Private F As Frame
Private Sub CommandButton1_Click()
Me.HIDE
Dim i As Integer
For Each C In Controls
    If TypeOf C Is Frame Then
      Set F = C
      For i = 0 To F.Controls.Count - 1
            If F.Controls.Item(i).Name = F.ActiveControl.Name Then
                Debug.Print i, F.ActiveControl.Name
            End If
            If F.Controls.Item(i).Value = True Then
                Debug.Print "Value", F.ActiveControl.Name
            End If
      Next
    End If
Next
End Sub

jjs 发表于 2007-4-27 13:25:46

你的用户名说明了一切
:丑陋:
它是如何发展 cmdr?

jjs 发表于 2007-4-27 13:27:50

你想用这些控件做什么?如果我们知道您需要做什么,可能会有一个更简单/更好的不同解决方案。
页: 1 [2]
查看完整版本: 在运行时填充窗体控件