Results 1 to 15 of 15

Thread: Animation in a PicBox?

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Animation in a PicBox?

    Is there a way to do animation in a PictureBox?

    can I just flip through pics in an imagelist?

    is there a better way?
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2
    Addicted Member
    Join Date
    Apr 2000
    Location
    England
    Posts
    246
    Yes, Use a Timer to flip through an Imagelist
    Some Days, i just get this feeling that i'm helping to write dozens of Viruses...

  3. #3
    Fanatic Member
    Join Date
    Jun 2001
    Location
    Baltimore,MD
    Posts
    536

    Talking Answer

    You can use a timer and a command button to make a image or picture move or you can you just use a timer and add a Loop
    Walter Richardson
    Striver2000 Christian Productions
    Iam seventeen but since I started VB in June of 01 GOD has been helping me excell by finding this great forum with a bunch of GREAT PEOPLE!

  4. #4

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    Im msut be tired....

    I cant get it to work!???

    How do i set the picbox.picture = Imagelist.????

    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5
    Frenzied Member
    Join Date
    Mar 2001
    Location
    You are HERE •™
    Posts
    1,300
    You always could try BitBlt. Here's a good example:
    http://www.planetsourcecode.com/xq/A...s/ShowCode.htm

  6. #6

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    Sweet! Thats Perfect!

    hey Bloodeye...that focus problem is still a problem...

    What happening is...when I am typing a response (or anything) in the webpage, and the timer goes to refresh the list of members online, the main Webbroser loses focus.

    I have WB1 & WB2

    WB1 Main window

    when I call:
    Wb2.Navigate "http://www.vbforums.com"

    wb1 loses focus...and I cant seem to capture the activeElement in the page, and retrun focus to it.

    any hints would be MOST apreciated!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  7. #7
    Frenzied Member
    Join Date
    Mar 2001
    Location
    You are HERE •™
    Posts
    1,300
    I haven't looked at VBForums Browser in a while. So let me see if I have this correct. WB1 is the main browser for (surfing, browsing, etc...), and WB2 is just being used to navigate to the main page so that it can determine who's online?

    If that's the case, I think your best bet would be to replace WB2 with URLDownloadToFile API. Then there would be no chance of losing focus. As far as capturing the ActiveElement in a page.....I'm sure it can be done, I don't have any ideas on how to do it though.

  8. #8

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    ok sounds good...
    I have never tried URLDownloadtofile....

    is there a way to determine its done?
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  9. #9
    Frenzied Member
    Join Date
    Mar 2001
    Location
    You are HERE •™
    Posts
    1,300
    Here's some code from Matthew Gates. Looks like he set's a boolean condition on the file being downloaded or not.

    VB Code:
    1. Private Declare Function URLDownloadToFile Lib "urlmon" _
    2. Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL _
    3. As String, ByVal szFileName As String, ByVal dwReserved As Long, _
    4. ByVal lpfnCB As Long) As Long
    5.  
    6. Private Function DownloadFile(URL As String, _
    7. LocalFilename As String) As Boolean
    8.     Dim lngRetVal As Long
    9.     lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
    10.     If lngRetVal = 0 Then DownloadFile = True
    11.  
    12. End Function
    13.  
    14.  
    15. Private Sub Command1_Click()
    16.  
    17.     Dim Success As Boolean
    18.     Success = DownloadFile("http://www.vbsquare.com/images/vbsquare.gif", "C:\vbsquare.gif")
    19.     If Success = True Then
    20.         Picture1.Picture = LoadPicture("C:\vbsquare.gif")
    21.     Else
    22.         Msgbox "Could not load image!", 16
    23.     End If
    24.  
    25. End Sub

  10. #10
    Fanatic Member
    Join Date
    Jun 2001
    Location
    Baltimore,MD
    Posts
    536

    try this

    insert this code in the timer and set the timer's interval for 5000.
    You can edit this the best way you see fit.

    Do until Picture1.top= > stopPoint
    Picture1.top=Picture1.top+40
    Loop
    Walter Richardson
    Striver2000 Christian Productions
    Iam seventeen but since I started VB in June of 01 GOD has been helping me excell by finding this great forum with a bunch of GREAT PEOPLE!

  11. #11

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    walter...thanks but i was lookin to make an Picbox act like and animated gif...not move around.

    BitBlt was the perfect answer.


    BTW...BloodEye..I have created the Picture in the COOLBOAR!!
    Like IE!!


    I have attached the EXE below...This is a So far... Like..hmmm...lets say a Beta I release
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  12. #12
    Frenzied Member
    Join Date
    Mar 2001
    Location
    You are HERE •™
    Posts
    1,300
    Hey, Looks good. What are you going to do about the menu at the top. Too bad you couldn't make that a child of the coolbar. I thought about using a coolbar, but then ran into that problem.

  13. #13

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    well...I scoured Microsofts site...and of the 8 or so examples using webbrowsers and coolbars...they ALL had a regular menu at the top....So my guess is i'll have to do that.

    or..I may create actual pictures of the menu words and make them dropdown buttons...Not sure yet..

    so features that you may not notice.

    the "forums" butoon will remember the current group..so after you choose the grop from the list...you can just click the main button to jump back to it(tooltip will show which group is chosen)
    in the code window...you can drag/drop the code from the browser. (sohow it keeps the font and coloring too!..so if there are red words..they stay red...for the moment at least. until its edited or saved/re-loaded)
    the bold button..is Toggle on off..but does not "tag" it yet...

    and the image for the "busy" in the coolbar is not finished..I just threw it together quickly...sooo.

    Glad you like it so far.

    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  14. #14
    Frenzied Member
    Join Date
    Mar 2001
    Location
    You are HERE •™
    Posts
    1,300
    I couldn't find the code window at first....and then I noticed the button on the toolbar. Nice rollup effect. Maybe you could get by with using regular buttons and using the CreatePopupMenu API for your menu. As a matter of fact that's what vbapi.com uses for an example for that API. You may have to play around with it to make it look right. Maybe I'll give the coolbar another chance and use the CreatePopupMenu API for my menus.

  15. #15

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    hmmm..thats a good idea!

    but I dont think you would need the api?
    just create the popups and call them by the click of the button.

    time to play!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

Posting Permissions

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



Click Here to Expand Forum to Full Width