谢谢。

解决方案 »

  1.   

    在窗体上加一个CommandButton和一个Frame,运行时单击按钮就会在Frame中添加
    Option ExplicitPrivate Sub Command1_Click()
    Dim opt1 As OptionButton, opt2 As OptionButton
    Set opt1 = Controls.Add("VB.OptionButton", "opt1", Frame1)
    Set opt2 = Controls.Add("VB.OptionButton", "opt2", Frame1)
    With opt1
        .Left = 200
        .Top = 400
        .Height = 200
        .Width = 1000
        .Caption = "Option1"
        .Visible = True
    End WithWith opt2
        .Left = 200
        .Top = 800
        .Height = 200
        .Width = 1000
        .Caption = "Option2"
        .Visible = True
    End WithEnd Sub