发布网友 发布时间:2024-10-10 07:58
共2个回答
热心网友 时间:2024-10-10 08:46
窗体上添加按钮,单击事件上加入以下代码即可! Private Sub Command1_Click() For i = 500 To 3000 Step 500 Line (500, i)-(3000, i) Line (i, 500)-(i, 3000) Next i End Sub热心网友 时间:2024-10-10 08:51
控件: picture1,command1 代码: Private Sub Command1_Click() Dim x, y, x1, y1 As Single x = Picture1.Width / 7 y = Picture1.Height / 7 Dim i As Integer For i = 1 To 6 Picture1.Line (x, y)-(x, Picture1.Height - y), RGB(0, 0, 255) x = x + Picture1.Width / 7 Next x = Picture1.Width / 7 y = Picture1.Height / 7 For i = 1 To 6 Picture1.Line (x, y)-(Picture1.Width - x, y), RGB(0, 0, 255) y = y + Picture1.Height / 7 Next End Sub 说明: 以上代码在picture1中绘制了有个楼主期望的6*6的横竖交叉线