1 Replies - 525 Views - Last Post: 19 December 2013 - 05:36 PM Rate Topic: -----

#1 Kolkata2013  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 22-August 13

Problem with Animated GIFs in Windows Form

Posted 18 December 2013 - 11:43 PM

I thought it would be nice to display some animated GIFs on some of my
forms. I put a PictureBox control on a form, and loaded my GIF file in.I have two forms
Form 1 and Form 2 with Gif picture box. The gif form worked fine when button is clicked, till the time
it does not have any codes in button.In form 1 I have codes as below.

Private Sub btn1_Click(sender As System.Object, e As System.EventArgs) Handles btn1.Click
Form2.show()
End sub

It worked fine and the animated gif file worked.But when I added below code it stooped responding.

Private Sub btn1_Click(sender As System.Object, e As System.EventArgs) Handles btn1.Click
Form2.show()
Dim XlApp As New Excel.Application
Dim Xlwb As Excel.Workbook
XlApp Visibe = True
xlwb = .Workbooks.open("D:\1-Test\Text.xlsx")
.....conti.

End sub
End Class
The code worked perfect for the excel but form2 is on screen which is not animating.I googled a lot for the reason and found it bacause of UI being busy in other works.
If you can help, I would be enormously grateful. And if I can make sense of the solution you offer, I may have to propose marriage. but we'll cross that bridge when we come to it.

Thanks
Ajit


End sub

Is This A Good Question/Topic? 0
  • +

Replies To: Problem with Animated GIFs in Windows Form

#2 poncianux  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 05-January 11

Re: Problem with Animated GIFs in Windows Form

Posted 19 December 2013 - 05:36 PM

Use threads or BackgroundWorkers

http://msdn.microsof...3(v=vs.95).aspx

Put all your excel code into BackgroundWorker and start it
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1