如何将string类型强制转换成form类型
form1.textbox1.text= "123 "
现在有由于需要需写成如下形式
dirm frm as string
dim tb as string
(?)(frm).controls(tb).text= "123 "
这问号里面应该填什么,知道的大侠请说一声~~~~
[解决办法]
Private Sub Command1_Click()
Dim mfrm As Form
Dim s As String
s = "Form2 "
For Each mfrm In Forms
If mfrm.Name = s Then
mfrm.Controls( "text1 ").Text = "hello this is test "
Exit Sub
End If
Next
Set mfrm = Forms.Add(s)
mfrm.Show
mfrm.Controls( "text1 ").Text = "hello this is test "
End Sub