本帖最后由 cfs43210 于 2014-5-25 23:12 编辑 #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 445, 192, 124)
$Button1 = GUICtrlCreateButton("插入", 10, 272, 145, 73)
$Pic1 = GUICtrlCreatePic("", 128, 24, 337, 185)
$Button2 = GUICtrlCreateButton("清空", 200, 272, 153, 81)
$Button3 = GUICtrlCreateButton("读取图片框", 376, 272, 153, 81)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
Local $aa
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$var = FileOpenDialog("浏览照片", @MyDocumentsDir & "", "图像文件 (*.jpg;*.bmp)", 1 + 4)
GUICtrlSetResizing($Pic1, $GUI_DOCKSIZE)
GUICtrlSetPos($Pic1, 128, 24, 337, 185)
$aa=GUICtrlSetImage($Pic1, $var)
Case $Button2
$aa=GUICtrlSetImage($Pic1, "") ;清空图片
Case $Button3
MsgBox(0, 0, $aa);图片框有无图片在时,怎样怪返回值
EndSwitch
WEnd
请问,用什么函数判断图片框是否存在图片,谢谢! |