VB绘图设计

来源:百度知道 编辑:UC知道 时间:2024/05/26 07:13:35
在picture控件里画直线.用command1按钮怎样去实现?
我的意思不是按下就出现直线.而是按下按钮之后,在picture控件里画直线.按钮相当于画图工具里选择直线进行画画

把下面代码保存为Form1.frm,然后双击打开此文件,运行即可。

VERSION 5.00
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = "画线"
ClientHeight = 2520
ClientLeft = 45
ClientTop = 435
ClientWidth = 6135
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2520
ScaleWidth = 6135
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command1
Caption = "画直线"
Height = 495
Left = 4680
TabIndex = 1
Top = 120
Width = 1215
End
Begin VB.PictureBox Picture1
Height = 2055
Left = 120
ScaleHeight = 1995
ScaleWidth = 40