Picture1.FillColor=QBColor(12) Picture1.ForeColor=QBColor(12) Picture1.Circle (0,0) ,2 X=Cos(C) * r
y=Sin(C) * r
Picture1.Fillcolor=QBColor(14) Picture1.ForeColor=QBColor(14) Picture1.Circle (x,y) ,0.5
c=c+st
If c>=2* 3.14159 Then c=c Mod (2*3.14159) End If End Sub
Private Sub Timer1_Timer()
PiCture1.RefreSh '重画图片框 End Sub
第三步:调试并运行程序。 第四步:按题目要求存盘。
3 综合应用题
解析:列表框用于在很多项目中作出选择的操作。列表框的ListCount属性表示表项的数量,列表项的排列从0开始,最后一项的序号为ListCount-1。使用列表项的Selected属性来表示列表框中哪些项被选中,该属性实际上是一个数组,各元素与列表框中的一项相对应,其取值为True或False,为True时表示选择了该项,为False表示未选择。解题步骤: 第一步:编写程序代码。 程序提供的代码:
Private Sub C1 Click() Dim i As Integer
For i=0 TO L1.LiStCount-1 'L1.?=True
Next End Sub
Private Sub C2 Click() Dim i As Integer
Open \ For i=0 To L1.ListCount-1 ' L1.ListIndex= ' Print #1, L1.?, L1.Selected(i)=False Next Close #1 End Sub 参考代码:
Private Sub C1_Click() Dim i As Integer
For i=0 To L1.ListCount-1 L1.Selected(i)=True
Next End Sub
Private Sub C2 Click() Dim i As Integer
Open \ For i=0 To L1.ListCount-1 L1.ListIndex=i Print #1, L1.Text, L1.Selected(i)=False Next
Close #1 End Sub
第二步:调试并运行程序 第三步:按题目要求存盘