VB编程 求教:有个程序有多个条件触发一个msgbox,怎么实现(代码具体点我是VB新手)!

来源:百度知道 编辑:UC知道 时间:2024/06/24 18:31:14
条件是关于picturebox控件载入的图片
if Pic1.Picture = LoadPicture("路径1") and Pic2.Picture = LoadPicture(“路径2”) then
x=msgbox("**",0,"**")
endif

我这样做的为什么不行啊?
分值不多请帮忙!
我没说清楚,是满足多个条件触发一个MSGBOX
不是那种多分支选择结构。我做的不行,为什么啊?
Private Sub Command2_Click()
If Pic1.Picture = LoadPicture(a) And Pic2.Picture = LoadPicture(b) Then
MsgBox "11111111", 0, "111111111"
End If
End Sub

同时满足多个条件才执行msgbox
if 条件 and 条件 then
msgbox
end if

只要一个条件满足,就执行msgbox
if 条件 or 条件 then
msgbox
end if

if Pic1.Picture = LoadPicture("路径1") and Pic2.Picture = LoadPicture(“路径2”) then
msgbox "**",0,"**"
end if

不要用x=msgbox("**",0,"**") ,这样消息框传值到X里面了,不会显示出来的!