工程名称与对话空的问题

fsybaby 2004-05-06 07:50:57
我明明把工程名称改了,可调用MsgBox后,对话框的标题仍是“工程1”,除非我在MsgBox中手动设置标题参数,可我不想这样做,请问怎么办?
...全文
113 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
BlueBeer 2004-05-07
  • 打赏
  • 举报
回复
这个问题我遇过,不知你的情况和我一不一样
你用记事本打开工程文件(.vbp)看看,最前面几行里有一行name,看它后面是不是还是“工程1”,如果是就把它改成你想要的内容

另,这个内容好像在设计时可以在工程属性里修改吧?
fsybaby 2004-05-07
  • 打赏
  • 举报
回复
谢谢 BlueBeer(1win) 我试了,他说得对,不过不是name那一行,是Title
shortppsy 2004-05-07
  • 打赏
  • 举报
回复
msgbox "test",information,"测试“
BlueBeer 2004-05-07
  • 打赏
  • 举报
回复
呵呵,不好意思:)

总之呢,只要是保存过的工程啊窗体啊,在之后又改名的,如果再打开时有问题,就用记事本打开工程文件找找看看,一般都可以解决~
broown 2004-05-07
  • 打赏
  • 举报
回复
你直接对*.exe用VC6改造其中的资源,对有form1字符的地方进行替换,应该可以!
再或者就用chinaren502(星星知我心) 兄所说办法!
broown 2004-05-07
  • 打赏
  • 举报
回复
你改工程名称是在 工程->属性里改的吗?
我改了都可以啊!
实在不行你就在每次使用msgbox时,都加上title参数得了!
或者again system
chinaren502 2004-05-07
  • 打赏
  • 举报
回复
这个问题我遇过,不知你的情况和我一不一样
你用记事本打开工程文件(.vbp)看看,最前面几行里有一行name,看它后面是不是还是“工程1”,如果是就把它改成你想要的内容

另,这个内容好像在设计时可以在工程属性里修改吧?
daisy8675 2004-05-06
  • 打赏
  • 举报
回复
在表單上丟個Timer為Timer1

'[一般]

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Sub Form_Load()
 Form1.AutoRedraw = True : Form1.Show
 Timer1.Enabled = True : Timer1.Interval = 1
 MsgBox "123", vbOKCancel, "testmsgbox"
End Sub
Private Sub Timer1_Timer()
 Dim r As Long, r1 As Long
 r = FindWindow(vbNullString, "testmsgbox")
 If r <> 0 Then
  r1 = FindWindowEx(r, ByVal 0&, "Button", "確定")
   If r1 <> 0 Then SetWindowText r1, "阿戊的Sure"
  r1 = FindWindowEx(r, ByVal 0&, "Button", "取消")
   If r1 <> 0 Then SetWindowText r1, "阿戊的Cancel"
  Timer1.Enabled = False
 End If
End Sub

這個是改變下面按鈕的
daisy8675 2004-05-06
  • 打赏
  • 举报
回复
Private Sub Command1_Click()
Dim strmsg As String
strmsg = MsgBox("this is a test", vbExclamation, " hello world")

End Sub

hello world就變成標題了
hewei2003 2004-05-06
  • 打赏
  • 举报
回复
重装VB

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧