Sub UserForm_Initialize()
UserForm_CommandButton1.Caption = "量化神奇之旅"
End Sub
'Sub CommandButton1_Click ()
' If CommandButton1.Caption = "金字塔--停止" or CommandButton1.Caption = "量化神奇之旅" Then
' CommandButton1.Caption = "金字塔--启动"
' Else
' CommandButton1.Caption = "金字塔--停止"
' End If
'End Sub
Sub UserForm_CommandButton3_Click ()
If UserForm_CommandButton1.Caption = "金字塔--停止" or UserForm_CommandButton1.Caption = "量化神奇之旅" Then
UserForm_CommandButton1.Caption = "金字塔--启动"
Else
UserForm_CommandButton1.Caption = "金字塔--停止"
End If
End Sub
Sub UserForm_Load()
'窗体启动显示时执行图标设置工作,(见上图中的左上角的窗体图标)
UserForm.SetTitileIcon("face_doc.ico")
End Sub
Sub UserForm_CommandButton1_Click()
UserForm_CommandButton2.SetFocus
End Sub
Sub UserForm_CommandButton2_Click()
UserForm_CommandButton1.SetFocus
End Sub
调用代码如下:
sub testform()
dim f
set f = new UserForm
f.Caption="指定对象的前景色"
end sub