| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 701 人关注过本帖
标题:vb中line画直线无显示,求解
只看楼主 加入收藏
小伊
Rank: 2
等 级:论坛游民
帖 子:27
专家分:33
注 册:2010-4-17
结帖率:66.67%
收藏
已结贴  问题点数:5 回复次数:2 
vb中line画直线无显示,求解
Dim prex As Double, prey As Double

Private Sub Form_Load()
DrawState = False
End Sub

Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
DrawState = True
prex = X
prey = Y
End If
If Button = 2 Then
Circle (X, Y), 300
End If
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If DrawState = True Then
Line (prex, prey)-(X, Y)
prex = X
prey = Y
End If
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
DrawState = False
End If
End Sub
2011-06-14 20:37
wube
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:23
帖 子:1820
专家分:3681
注 册:2011-3-24
收藏
得分:5 
我可以画线阿〜

程序代码:
Option Explicit

Dim prex As Double, prey As Double, DrawState As Boolean

Private Sub Form_Load()
    DrawState = False
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

    If Button = 1 Then
        DrawState = True
        prex = X
        prey = Y
    End If
   

    If Button = 2 Then
        Circle (X, Y), 300
    End If
   

End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    If DrawState = True Then
        Line (prex, prey)-(X, Y)
        prex = X
        prey = Y
    End If
   

End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

    If Button = 1 Then
        DrawState = False
    End If
   

End Sub

图片附件: 游客没有浏览图片的权限,请 登录注册


不要選我當版主
2011-06-14 21:51
小伊
Rank: 2
等 级:论坛游民
帖 子:27
专家分:33
注 册:2010-4-17
收藏
得分:0 
谢!
2011-06-14 22:32
快速回复:vb中line画直线无显示,求解
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017419 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved