如何在picture裡畫正方形的vb程式

2021-03-12 07:36:21 字數 1441 閱讀 4693

1樓:匿名使用者

option explicit

private ax, ay as integer

private sub form_load()

me.autoredraw = true

me.scalemode = 3

shape1.visible = false

end sub

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

ax = x

ay = y

shape1.left = ax

shape1.top = ay

shape1.width = 0

shape1.height = 0

shape1.visible = true

end sub

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

if button = 1 then

if x >= ax then

shape1.width = x - ax

else

shape1.left = x

shape1.width = ax - x

end if

if y >= ay then

shape1.height = y - ay

else

shape1.top = y

shape1.height = ay - y

end if

end if

end sub

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

shape1.visible = false

me.line (shape1.left, shape1.

top)-(shape1.left + shape1.width, shape1.

top + shape1.height), , b

end sub

2樓:匿名使用者

以正方形對角線的交點為圓心,以正方形邊長的一半為半徑畫標準圓!circle (x.y) r!

3樓:匿名使用者

private sub ***mand1_click()static i

shape1.shape = i

i = i + 1

if i = 6 then i = 0

end sub

用baishape控制項吧du

。zhi

簡單dao實用內。。容

cad中如何在菱形裡畫正方形,如何在CAD裡面畫出菱形

先用對角連線確定菱形中心,然後以中心為基點,在原位置複製乙個菱形,將這兩個菱形中的任意乙個菱形,以中心為基點旋轉90度,連線這兩個菱形的四個交點就是正方形。1。先把對角線畫好,2.對角線的交點設為o,沿其中對角線作一條過o的射線l,3.將l以o點為基點,旋轉45度角,4。通過對稱映象,射線有4條,分...

畫正方形和長方形 使他們的周長相等

可以先畫乙個邊長是3釐公尺的正方形,計算出它的周長是12釐公尺,由於要畫的長方形的周長得和正方形周長相等,那麼長方形的周長也是12釐公尺,利用長方形的周長公式 長 寬 2 周長算出 長 寬 12 2 6,也就可以畫出長是5釐公尺寬是1釐公尺,長是4釐公尺寬是3釐公尺的兩種形狀的長方形。利用這種方法可...

裡空白出怎麼打正方形,word 裡空白出怎麼打正方形

插入 形狀 選擇矩形,按住shift鍵拖動畫出正方形。如果在乙個來段落的開始處 空白處 自顯示兩個 小正方bai形 du的話 先在文件的zhi任意處插入 方dao 框 符號 選擇這個符號,ctrl c 即複製這個符號,只能用這種方法複製 全選文件,ctrl h,開啟替換對話方塊 查詢範圍 高階 段落...