这是因为窗体尚在加载过程之中,换句话说,窗体本身都没有加载,你就要设置控件的焦点是不行的。可换为:Private Sub Form_Activate()Dim i, sum Text1.Text = "" Text1.SetFocus For i = 1 To 9 sum = sum + i Next i Text1.Text = sumEnd Sub