ksdf.net
当前位置:首页>>关于vb做出三角形代码的资料>>

vb做出三角形代码

定义好三角形的三个点,用line画线连接即可。 示例如下: Private Sub Form_Load()Me.AutoRedraw = TrueDim x As IntegerDim y As IntegerCurrentX = 1500CurrentY = 500Line -(3000, 2000), RGB(0, 0, 255)Line -(1500, 2000), RGB(0, 0, 255)L...

一、控制行首的空格数目 二、控制每行的星号数目 三、控制行数。 代码如下: Private Sub Command1_Click() Cls Do 行数 = Int(InputBox("你要多少行?少于一行可以行!")) Loop Until 行数 > 1 For i = 1 To 行数 For j = 1 To i - 1 '行首的空...

Private Sub Command1_Click() Dim n As Integer Dim i As Integer, j As Integer, k As Integer n = InputBox("输入你要的行数") For i = 1 To n Print Tab(n * 2 - i); For j = 1 To i Print Trim(Str(j)); Next For k = i - 1 To 1 Step -1 P...

Private Sub Form_Click() Cls n = Val(InputBox("输入行数")) m = Left(InputBox("输入符号"), 1) If (n > 100 Or n < 1) Then Print "n 输入1~100" Exit Sub End If For i = n To 1 Step -1 Print Tab(40 - i) For j = n - i To 1 Step -1 Pri...

Private Sub Command1_Click() For i = 5 To 1 Step -1 Print Space(10 -i); For j = 2 * i - 1 To 1 Step -1 Print "*"; Next j Print Next i End Sub

Dim a As DoubleDim b As DoubleDim c As DoubleDim s As DoubleDim temp As DoublePrivate Sub Command1_Click() a = Val(Text1.Text) b = Val(Text2.Text) c = Val(Text3.Text) If ((a + b) > c) And ((a + c) > b) And ((b + c) > a) And ((a...

Private Sub Command1_Click() n = Val(InputBox("请输入一个正整N")) For i = 1 To n Print Spc(2 * i); For j = 1 To n + 1 - i Print "* "; Next j Print Next i End Sub

程序运行的时候单击窗体,要求输入行数。输出相应的对应图形。把代码复制到窗体即可。 代码如下: Private Sub Form_Click() Form1.Cls Dim a, i, j, k As Integer a = Val(InputBox("请输入行数!")) For i = 1 To a For k = 1 To a - i Print ...

'这个你参考下,是刚给别人写的,你只要在后面加入求周长面积的代码就可以了 Dim a, b, c As Double Dim P As String Private Sub Command1_Click() If IsNumeric(Text1.Text) And IsNumeric(Text2.Text) And IsNumeric(Text3.Text) Then a = Va...

先把form的autoredraw属性改成true,代码如下: ========================== Option Explicit Dim a(10, 10) As Long Dim b(10) As String Dim i As Byte Dim j As Byte Private Sub Form_Load() a(0, 0) = 1 For i = 1 To 9 For j = 1 To 9 a(i...

网站首页 | 网站地图
All rights reserved Powered by www.ksdf.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com