Private Sub Text1_Click(Index As Integer)
FOR I=0 TO 4
Text1(i).BackColor = vbgreen'点击的黄色
Text2(i).BackColor = vbWhite'没点击的白色
next
End Sub
也可以设置个行的变量cur_color,默认可以设置为第一行
点击某行,先清除cur_color行背景,在cur_color=某行,设置某行颜色为绿色
[此贴子已经被作者于2019-1-17 18:52编辑过]
Dim xx1 As Integer Private Sub Form_Load() For i = 0 To 6 Text1(i).Text = "2017-01-17" Text2(i).Text = "拉伸12" Text3(i).Text = "圆材(mm)" Text4(i).Text = "18" Text5(i).Text = "50" Next i End Sub Private Sub Text1_Click(Index As Integer) xx1 = Index Call GY End Sub Private Sub Text2_Click(Index As Integer) xx1 = Index Call GY End Sub Private Sub Text3_Click(Index As Integer) xx1 = Index Call GY End Sub Private Sub Text4_Click(Index As Integer) xx1 = Index Call GY End Sub Private Sub Text5_Click(Index As Integer) xx1 = Index Call GY End Sub Private Sub GY() For i = 0 To 6 Text1(i).BackColor = &HFFFFFF Text2(i).BackColor = &HFFFFFF Text3(i).BackColor = &HFFFFFF Text4(i).BackColor = &HFFFFFF Text5(i).BackColor = &HFFFFFF Next i Text1(xx1).BackColor = &H109901 Text2(xx1).BackColor = &H109901 Text3(xx1).BackColor = &H109901 Text4(xx1).BackColor = &H109901 Text5(xx1).BackColor = &H109901 End Sub