excel - 在visual basic中创建一条线和圆
问题描述
我还没有找到正确的代码来画一条线和一个圆。
我尝试了 4 种不同的代码,但我遇到了变量和对象的问题。
这是我的代码:
Option Explicit
Private flag As Boolean
'Variables
Dim x1 As Single, y1 As Single, x2 As Single, y2 As Single
'Dibuja el circulo en el formulario
Private Sub Dibujar_Circulo()
Dim cx As Single, cy As Single, dx As Single
Dim dy As Single, Radio As Single
cx = x1
cy = y1
dx = x1 - x2
dy = y1 - y2
' calcula el radio
Radio = Sqr(dx * dx + dy * dy)
'Dibuja el círculo
Circle (cx, cy), Radio
End Sub
我只得到了一个没有任何动作的按钮:(
解决方案
推荐阅读
- javascript - 解构对象数组
- excel - 在日期范围之间求和小时,在excel中查找单独的表格
- java - IntelliJ IDEA:如何使用 --args 运行 gradle 应用程序插件运行任务
- javascript - 使用许多 jsonp 请求检索数据
- postgresql - Postgres:在特定数据库中导入
- javascript - 从本地图像中读取 RGB 字节
- boost-spirit - Boost 自定义解析器无法使用 qi::parse
- wordpress - 为什么在 WooCommerce WordPress 商店下订单时会出现错误栏?
- html - 如何使用某些段落设置“弹性比率”
- azure-blob-storage - Azure 存储:仅返回 Azure 存储中 BlobTier Cold 的 Blob