📄 12805.html
字号:
<html>
<head>
<title>制作"选取方框"的疑惑</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>制作"选取方框"的疑惑</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by <a href="mailto:shinn@ms1.hinet.net">笋子</a> on May 10, 1999 at 21:03:32:<p>
我在做图形的"选取方框"时,却发现所框选出来的起始范围会相反耶...<br>他是以表单的"左上"到"右下"这一条线为主...程式码如下,请帮忙解惑...<br>谢谢,表单上只需有一个 Shape1 的物件....<br>Private Type CursorPosition<br> X As Single<br> Y As Single<br>End Type<p>Dim CursorStart As CursorPosition<br>Dim CursorEnd As CursorPosition<p>Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)<br>Shape1.Width = 0: Shape1.Height = 0<br>CursorStart.X = X<br>CursorStart.Y = Y<br>Shape1.Top = X<br>Shape1.Left = Y<br>Shape1.Visible = True<br>End Sub<p>Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)<br>Dim CursorNow As CursorPosition<br>CursorNow.X = X<br>CursorNow.Y = Y<br>If Button Then<br>Shape1.Width = CursorNow.X - CursorStart.X<br>Shape1.Height = CursorNow.Y - CursorStart.Y<br>End If<br>End Sub<p>Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)<br>CursorEnd.X = X<br>CursorEnd.Y = Y<br>Shape1.Height = CursorEnd.Y - CursorStart.Y<br>Shape1.Width = CursorEnd.X - CursorStart.X<br>End Sub<br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 12805-->
<!--top: 12812--><li><a href="12812.html">错一堆</a> <b>小吴</b> <i>09:54:36 5/11/99</i>
(<!--responses: 12812-->1)
<ul><!--insert: 12812-->
<!--top: 12820--><li><a href="12820.html">啊!!!真的是不好意思</a> <b>笋子</b> <i>11:36:10 5/11/99</i>
(<!--responses: 12820-->0)
<ul><!--insert: 12820-->
</ul><!--end: 12820-->
</ul><!--end: 12812-->
</ul><!--end: 12805-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -