Private Sub Command1_Click()
Command1.Caption = IIf(Command1.Caption = "原标题", "新标题", "原标题")
End Sub
定义全局变量
dim blnClicked as boolean
dim strCaption1 as string
dim strCaption2 as string
'strCaption1 和 strCaption2 的初始化自己做。
在按钮的Click()过程函数中添加如下代码:
blnClicked = not blnClicked
if(blnClicked) then me.caption=strCaption1
else me.caption = strCaption2
end if