option explicit
private sub form_mousedown(button as integer, shift as integer, x as single, y as single)
if button = 2 then '若單擊滑鼠右鍵
popupmenu mnuformcolor '在窗體上建立彈出式選單
end if
end sub
private sub mnucolor_click(index as integer) '出錯點錯把mnucolor打成mnuformcolor 執行不了
select case index '以子選單的索引作為變數
case 0 '若索引為0
me.backcolor = vbred '窗體的背景色為紅色
case 1
me.backcolor = vbgreen
case 2
me.backcolor = vbblue
end select
end sub
VB工程 百例92 拍照窗體
option explicit private sub form load dim wbitmap 定義變數 me.autoredraw true 使窗體能夠自動重繪 wbitmap createcompatiblebitmap me.hdc,0,0 建立乙個位圖,高度和寬度均為0 selectob...
VB工程 百例64游標位置
option explicit private sub command1 click txt1.text 歡迎來到廊坊師範學院 end sub private sub command2 click txt1.text end sub private sub command3 click endend...
VB工程 百例69 訊息框
option explicit private sub form click dim x as integer x msgbox 你單擊的是窗體,是嗎?35,詢問框 if x 6 then 若們四個box的函式的返回值是6 msgbox 你選擇了 是 按鈕 vbinformation,資訊框 彈出的...