Window应用程序中的事件处理程序 [英] Event Handler in Window application

查看:67
本文介绍了Window应用程序中的事件处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为此在Windows应用程序中创建事件处理程序,因此我编写了以下代码...当我单击转换按钮时,我有一个gif图像,然后我的图像正在加载,即图像正在旋转,直到过程完成为止,这就是我的问题.任务...但是当我单击转换按钮时,我的图像被挂起了,这是因为它没有旋转,我不知道这是什么问题...

我的表格

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

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

推荐答案

如果您在图片框中放入动画gif,则会对其进行动画处理(网络/窗口).有什么问题?
If you put an animated gif in the picturebox it animates (web/ windows). what is the problem?


为此使用后台工作程序,因为不使用后台工作程序,您的应用程序将在同一线程中运行.
检查这些链接
BackgroundWorker线程和支持取消功能 [ BackgroundWorker和ProgressBar演示 [
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[^]


这篇关于Window应用程序中的事件处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆