dcsimg
Results 1 to 5 of 5

Thread: [RESOLVED] Picture is not stable (hide/show) jumping

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    101

    Resolved [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)
    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

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,234

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,556

    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.



  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    101

    Re: Picture is not stable (hide/show) jumping

    Quote Originally Posted by LaVolpe View Post
    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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    101

    Re: Picture is not stable (hide/show) jumping

    Quote Originally Posted by 4x2y View Post
    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)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width