[RESOLVED] Picture is not stable (hide/show) jumping
Hi dears
This is my code, at runtime loaded picture is not stable (hide/show) how to load it stable.
I think my app is not sure loaded picture correct or not (not decided yet) :p :D
Please help
Code:
Private Sub Timer1_Timer()
If Val(L1.Caption) = 1 Then
BLP.Picture = LoadPicture(App.Path + "\BL\NET10A.ICO")
L2.Caption= "Yes"
ElseIf Val(L1.Caption) = 0 Then
BLP.Picture = LoadPicture(App.Path + "\BL\NET10B.ICO")
L2.Caption= "No"
Else
BLP.Picture = LoadPicture(App.Path + "\BL\NET10B.ICO")
L2.Caption= "Unknown"
End If
End Sub
Note:Timer Interval is 500
Re: Picture is not stable (hide/show) jumping
Not stable? Are you talking about flicker? If so, and BLP is a picturebox, try setting BLP.AutoRedraw=True.
If this does not resolve the problem, let us know what type of object BLP is.
Re: Picture is not stable (hide/show) jumping
LoadPicture is executed each 500 ms, why you put that code inside Timer? As far as loaded picture depend on L1.Caption, it is better to put that code inside L1_Change event, by this way LoadPicture will executed only when L1.Caption change.
Re: Picture is not stable (hide/show) jumping
Quote:
Originally Posted by
LaVolpe
Not stable? Are you talking about flicker? If so, and BLP is a picturebox, try setting BLP.AutoRedraw=True.
If this does not resolve the problem, let us know what type of object BLP is.
Yes I mean flickering, BLP is (Image object) not PictureBox.
Re: Picture is not stable (hide/show) jumping
Quote:
Originally Posted by
4x2y
LoadPicture is executed each 500 ms, why you put that code inside Timer? As far as loaded picture depend on L1.Caption, it is better to put that code inside L1_Change event, by this way LoadPicture will executed only when L1.Caption change.
Thank you 4x2y it is good and new idea for me. It resolved my problem
Sincerely
Mahmood Khaleel Pirani (Biologist)
#MKhP7
(Note:I'm not programmer, but it is my dream to learn programming)