---
title: "简单模拟word中对插入直线的操作"
author: "limitforest"
date: "2012-01-04T16:59:00Z"
tags: []
slug: "word"
draft: false
lastmod: "2012-04-17T19:50:51Z"
id: 1488773
url: "https://limitforest.iteye.com/blog/1488773"
---

简单模拟word中对插入直线的操作。可以画直线，然后可以选择直线进行移动、拉伸、删除。并能显示直线的距离。  
操作：点击按钮开始画线。鼠标左键点击一条直线进行移动，选择端点进行拉伸。

![](http://hi.csdn.net/attachment/201201/4/0_1325667668ng45.gif)

鼠标右键点击直线，删除它。

![](http://hi.csdn.net/attachment/201201/4/0_1325667802Z45A.gif)

附上源代码