VB编程题目求解1. 该工程文件中有两个窗体fo

1个回答

  • 源码在附件中,你可以直接下载打开第一题:建立两个窗体并加入按钮,依次点vb菜单“工程” - “工程1属性” “通用” 启动对象设为form2窗体代码如下:form1代码:Private Sub Command1_Click()Form1.ShowEnd Subform2代码:Private Sub Command1_Click()Unload MeEnd Sub第二题:窗体上放置 command1,text1控件和Option1控件数组,形式如你图所示,代码如下:Private Sub Command1_Click()Dim n As Long, s1 As Long, s2 As Long, c As Longs1 = 1: s2 = 1For i = 0 To Option1.Count - 1If Option1(i).Value Then n = Option1(i).Caption For j = 3 To n c = s1 + s2 s1 = s2 s2 = c Debug.Print j, c Next Text1 = s2 Exit SubEnd IfNextEnd Sub