高手請進 VB程式右擊螢幕上的兩點,算出兩點之間的實際距離(單位 CM)

2022-11-27 05:35:18 字數 1304 閱讀 4529

1樓:匿名使用者

dim curx as single

dim cury as single

private sub form_load()form1.scalemode = vbcentimetersend sub

private sub form_mousedown(button as integer, shift as integer, x as single, y as single)

if button = vbrightbutton thencurx = x

cury = y

end if

end sub

private sub form_mouseup(button as integer, shift as integer, x as single, y as single)

if button = vbrightbutton thenmsgbox sqr((x - curx) ^ 2 + (y - cury) ^ 2) & " cm"

end if

end sub

'測試已通過,完全正確

2樓:炫斯你

dim xx as single

dim yy as single

private sub form_mousedown(button as integer, shift as integer, x as single, y as single)

label1.caption = ""

if button<>2 then exit subxx = x

yy = y

end sub

private sub form_mousemove(button as integer, shift as integer, x as single, y as single)

if button<>2 then exit sublabel1.caption = sqr((x - xx) * (x - xx) + (y - yy) * (y - yy)) / 15 / 45.2 & "cm"

end sub

3樓:

算出兩點間的畫素差,再根據螢幕的解析度換算成英寸,再由英寸換算成釐米,只是你說的右擊螢幕上的兩點沒看明白????

4樓:匿名使用者

程式右擊螢幕上的兩點,算出兩點素差,再根據螢幕的解析度換算成英寸,再由英寸

5樓:匿名使用者

留下郵箱,我做出來了,怎麼發給你

滑鼠可以在任意位置

vb6兩個基本特點,VB應用程式的兩個基本特點是

隨著visual basic 的逐步發展完善和功能的不斷括展,很多軟體開發人員利用visual basic 開發了大量的應用軟體。visual basic 已經成為使用人數最多,應用領域最廣的程式設計語言和軟體開發工具.特點 1.物件導向和視覺化的程式設計.visual basic 實現了物件的封裝...

XP高手請進我的歡迎螢幕和快速使用者切換被禁用

1.用安全模式進入,在c盤搜尋scgina.dll檔案,並刪除 如果還不行,就把最近安裝的程式在新增刪除程式中解除安裝 2.還搞不定的話,只好重灌系統了 今天裝監控攝像頭軟體,中招了,用 軟體安裝監視 工具total uninstall 重新裝軟體,在用此工具解除安裝搞定 後來研究發現 監控攝像頭軟...

用vb60設計程式,在窗體上的標籤label中

private sub form load label1.caption 歡迎進入vb的程式設計世界 label1.font 文泉驛等寬正黑 不要意思咱機子上沒有 楷體 label1.fontsize 14.25label1.fontbold truelabel1.backcolor vbreden...