如何用vb编程在窗体中输出九九乘法表(全部、上三角、下三角)?

急需,求求各位了

'点击窗体出现九九乘法表,如果显示不全,适当调大窗体
Private Sub Form_Click()
Dim a As Integer
Dim b As Integer
Dim c As String
For a = 1 To 9
c = ""
For b = 1 To 9
c = c & a & "×" & b & "=" & a * b & vbTab
Next b
Print c
Next a
End Sub
温馨提示:内容为网友见解,仅供参考
无其他回答

如何用VB编写打印九九乘法表?
用VB编写打印九九乘法表可以参考下面的代码:按钮单击代码 Private Sub Command1_Click()For i = 1 To 9 For j = 1 To i Print i & "*" & j & "=" & i * j & " ";Next j Print Next i End Sub

怎样用vb在窗体上输出九九乘法表?
Private Sub Form_Click()Dim i, j As Integer Dim s As String Print Tab(35); "九九乘法表"For i = 1 To 9 For j = 1 To i s = i & "×" & j & "=" & i * j Print Tab((j - 1) * 9 + 2); s;Next j Print Next i End Sub ...

利用VB语言编程:输出九九乘法表
上面的哪是九九乘法表啊 我这有两种 Private Sub Form_Load()Me.AutoRedraw = True Cls For j = 1 To 9 For k = 1 To 9 If k > j Then Exit For Print k & "*" & j & "=" & j * k; " ";Next k Print Next j End Sub '''Private Sub Form_Click()Dim i, j As ...

用vb编写九九乘法表
用VB程序怎么做九九乘法表的步骤如下:创建显示结果的窗体:编写按钮宏 Private Sub Command1_Click()Dim a, b As Integer Dim s As String: s = ""For a = 1 To 9 For b = 2 To 9 s = s & a & "*" & b & "=" & b * a If b <> 9 Then s = s & Space(1) Else...

用VB程序怎么做九九乘法表?
Public Class Form1 Private Sub Button1_Click(sender As Object,e As EventArgs)Handles Button1.Click Dim i,j As Integer Dim se As String Label1.Text=""For i=1 To 9 Step 1 For j=1 To 9 Step 1 se=i&"x"&j&"="&i*j Label1.Text&=se&Space(10-Len(se))Next Label1....

用vb在文本框里输出九九乘法表
vb中输出九九乘法表,可以参考下面的代码:Private Sub Form_Click()For a = 1 To 9 For b = 1 To a Print b; "*"; a; "="; b * a;Next b Print Next a End Sub

怎么用VB打九九乘法表
三角形的九九乘法表 Private Sub Form_Load()Dim i, j, s For i = 1 To 9 For j = 1 To i s = s & j & "×" & i & "=" & IIf(Len(i * j) < 2, i * j & " ", i * j) & " "Next s = s & vbCrLf Next MsgBox s End Sub ...

请问如何用编程编写九九乘法表(并写出操作步骤)?
1. 利用Access数据库创建交互式窗体,配置所需组件以实现人机交互。2. 第一个文本框输入数字,决定乘法表的行数。3. 第二个文本框展示生成的九九乘法表结果。代码讲解:九九乘法表的核心设计是使用两个嵌套的ForNext循环。大循环(i)控制行数,小循环(j)生成每一行的乘法和结果。代码简洁,易于理解...

用VB:打印出九九乘法表(要求有表头,格式对齐)。
Private Sub Form_Click()Print Tab(35); "九九乘法表"Print Tab(35); "---"For i = 1 To 9 For j = 1 To i se = CStr(i) & "*" & CStr(j) & "=" & CStr(i * j)Print Tab((j - 1) * 9 + 1); se;Next j Print Next i End Sub ...

VB打印九九乘法表上三角
'添加窗体Form1,按钮Command1,然后添加如下代码:PrivateSubCommand1_Click()Dimi%,j%,s Fori=1To9 Forj=1To9-i+1 s=s&j&"*"&i&"="&i*j&Chr(9)Next s=s&vbCrLf Next Prints EndSub

相似回答