å¨VBä¸å¯ä½¿ç¨ LoadPicture å½æ°å°å¾çå è½½å°çªä½ç PictureBox
æ§ä»¶å¹¶ä»æ§ä»¶ä¸æ¸
é¤æ该å¾çã
Private Sub Command1_Click()
Picture1.Picture = LoadPicture() 'æ¸ é¤ pictureboxã
End Sub
LoadPicture å½æ°ï¼å°å¾å½¢è½½å ¥å°çªä½ç Picture å±æ§ãPictureBox æ§ä»¶æ Image æ§ä»¶ã
LoadPicture å½æ°ç¤ºä¾
æ¬ä¾ä½¿ç¨ LoadPicture å½æ°å°å¾çå è½½å°çªä½ç PictureBox
æ§ä»¶å¹¶ä»æ§ä»¶ä¸æ¸
é¤æ该å¾çãè¦è¯ç¨æ¤ä¾ï¼å° PictureBox æ§ä»¶æ·»å å
¥ Form 对象ï¼ç¶åå°ä»¥ä¸ä»£ç ç²è´´å° Form
ç声æé¨åï¼ç¶åè¿è¡æ¤ä¾ï¼åå» Form ã
Private Sub Form_Click ()
Dim Msg as String ' 声æåéã
On Error Resume Next ' 设置é误å¥æã
Height = 3990
Width = 4890 ' 设置é«åº¦å宽度ã
Picture1.Picture = LoadPicture("PAPER.CUR", vbLPCustom, vbLPColor, 32, 32) ' å è½½å
æ ã
If Err Then
Msg = "Couldn't find the .cur file."
MsgBox Msg ' æ¾ç¤ºé误æ¶æ¯ã
Exit Sub ' å¦æåçé误åéåºã
End If
Msg = "Choose OK to clear the bitmap from the form."
MsgBox Msg
Picture1.Picture = LoadPicture() 'æ¸
é¤ pictureboxã
End Sub