Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to create event handler in windows application for that i write the following code...i have one gif image when i click convert button then my image are loading that is the image is rotating until the process completes this is my task...but when i click convert button then my image are hanged that is it's not rotating i dont know what is the problem...

my form

VB
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        PictureBox1.Visible = False
        Label1.Text = "Ready!!!"
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        PictureBox1.Visible = True
        Label1.Text = "Converting, Please Wait!!!"
        Me.Refresh()
        Shell("runsometimes.exe", AppWinStyle.Hide, 1)
        Label1.Text = "Successfully Converted!!!"
        PictureBox1.Visible = False
    End Sub
End Class
Posted
Updated 15-Mar-11 20:28pm
v2
Comments
Toniyo Jackson 16-Mar-11 1:49am    
Asp.net windows application??????
Sergey Alexandrovich Kryukov 16-Mar-11 2:29am    
I modified title and tags, it was gibberish...

If you put an animated gif in the picturebox it animates (web/ windows). what is the problem?
 
Share this answer
 
Comments
shanthikalai 16-Mar-11 2:04am    
ya i put animated gif only,but it's hanging when my application runs i dont know the problem..
pankajupadhyay29 16-Mar-11 2:58am    
this will not work as the windows application is running in single thread synchronously.
Albin Abel 16-Mar-11 8:42am    
I was not knowing she is doing something with multi threading. I saw from her coding she toggles a picture box visibility, in between open a application independent to UI thread. My problem misunderstood the question. Thanks for correcting it
Espen Harlinn 16-Mar-11 19:18pm    
So together with code in play you've provided a reasonable hint on how to solve this - a 5
use background worker for this as without using background worker your application will run in same thread.

check these links
BackgroundWorker Threads and Supporting Cancel[^]

BackgroundWorker and ProgressBar demo[^]
 
Share this answer
 
Comments
Espen Harlinn 16-Mar-11 19:18pm    
So together with AlbinAbel you've provided a reasonable hint on how to solve this - a 5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900