ljpnb 发表于 2005-4-10 22:08:00

[求助]这个userform1窗口如何关掉

看下面这段:
Private Sub CommandButton1_Click()
               ' This example creates a text object in model space.
                       ' It then returns the text string for that object.
                       
                       Dim dimobj As AcadDimension
                       Dim text As String
                       
                       
                       UserForm1.Showmodal = False
                       
                                               
                       ' Define the text object
                       ThisDrawing.Utility.GetEntity dimobj, basePnt, "Select an object"
                       
                       '修改尺寸文字
                       
                               text = dimobj.Measurement
                               UserForm1.Showmodal = True
                               
                               
                               'Print text
                               TextBox1.text = text
                               
End Sub
Private Sub CommandButton2_Click()
End
End Sub
程序中 UserForm1.Showmodal = False错误,我的意思是当点CommandButton1时,进行选择标注尺寸,当尺寸选取后UserForm1.Showmodal =True,即窗口重新显示,不知道应该如何写?

mccad 发表于 2005-4-10 22:27:00

UserForm1.Show是显示
UserForm1.Hide是隐藏

ljpnb 发表于 2005-4-11 08:23:00

多谢mccad,这两句我自己也试出来了,但这个程序还是不能正常运行,我选择一个标注尺寸后,TextBox1.text 没的反应,还是空白的。指再指点一下,谢谢!

ljpnb 发表于 2005-4-11 11:09:00

问题已解决了!
页: [1]
查看完整版本: [求助]这个userform1窗口如何关掉