VB6.0编辑按钮的问题

来源:百度知道 编辑:UC知道 时间:2024/06/30 23:57:06
我几天前才使用VB6.0,是个新手,在用CommandButton编辑出一个普通的按钮,并且设置代码
Private Sub Command1_Click()
MsgBox "内容"
End Sub
可是点击后弹出窗口的标题却是 工程1 ,请问如何改成其他的?

你改一下工程的名字就可以了。你的工程没有命名就是这样的。
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you want to continue ?" ' 定义信息。
Style = vbYesNo + vbCritical + vbDefaultButton2 ' 定义按钮。
Title = "MsgBox Demonstration" ' 定义标题。
Help = "DEMO.HLP" ' 定义帮助文件。
Ctxt = 1000 ' 定义标题
' 上下文。
' 显示信息。
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' 用户按下“是”。
MyString = "Yes" ' 完成某操作。
Else ' 用户按下“否”。
MyString = "No" ' 完成某操作。
End If