VB6.0Private Sub Timer_Timer()
    If Pic_OPbackground.Left = -534 * Screen.TwipsPerPixelX Then
        Timer.Enabled = False
        Text1.Text = "1"
    Else
        Pic_OPbackground.Left = Pic_OPbackground.Left - 0.1 * Screen.TwipsPerPixelX
    End If
End Sub执行后只执行else后的语句,尝试了设Pic_OPbackground.Left = -534 * Screen.TwipsPerPixelX,画面存在问题,类似的Left Top类的属性不能用像素设置?PS:VB不能用运算符"-="?

解决方案 »

  1.   

    Pic_OPbackground.Left - 0.1 * Screen.TwipsPerPixelX
    这句话很难保证Pic_OPbackground.Left = -534 * Screen.TwipsPerPixelX 成立
    改成 If Pic_OPbackground.Left <= -534 * Screen.TwipsPerPixelX Then
    -=不支持
      

  2.   

    谢谢yachong的回答,改成 If Pic_OPbackground.Left <= -534 * Screen.TwipsPerPixelX Then后满足条件的时间点多了,可是我执行后,问题仍然存在
    问题的关键在于Pic_OPbackground.Left = -534 * Screen.TwipsPerPixelX 这句的解释上,因为我尝试过Pic_OPbackground.Left = -534 * Screen.TwipsPerPixelX直接设置这句语句,显示画面是存在问题的,表现现象为只显示背景色
      

  3.   

    可改成 If Pic_OPbackground.Left <= -534 * Screen.TwipsPerPixelX Then
     问题应该解决了!