= null) onDownLoadProgress(100 current }); } else ...{ this.progressBar1.Maximum = (int)total; this.progressBar1.Value = (int)current; } } } /**//// <summary> /// 下载类 /// </summary> public class Downloader ...{ //委托 public delegate void dDownloadProgress(long total new object[] ...{ total long current) ...{ if (this.InvokeRequired) ...{ this.Invoke(new Downloader.dDownloadProgress(downloader_onDownLoadProgress) EventArgs e) ...{ //用子线程工作 new System.Threading.Thread(new System.Threading.ThreadStart(StartDownload)).Start(); } //开始下载 public void StartDownload() ...{ Downloader downloader = new Downloader(); downloader.onDownLoadProgress += new Downloader.dDownloadProgress(downloader_onDownLoadProgress); downloader.Start(); } //同步更新ui void downloader_onDownLoadProgress(long total "窗口名称"); 发送消息 pWnd ->postmessage(WM_LBUTTONDOWN 枚举出其它窗口的控件之后 i); System.Threading.Thread.Sleep(100); } } }
|||
看看这个帖子: http://topic.youkuaiyun.com/t/20050809/11/4197655.html 代码如下:using System;using System.ComponentModel;using System.Windows.Forms;namespace WindowsApplication4...{ /**//// <summary> /// gui 类 /// </summary> public partial class Form1 : Form ...{ public Form1() ...{ InitializeComponent(); } private void button1_Click(object sender
SendMessage只能支持前台CWnd *pWnd=CWnd::FindWindoW(NULL LPARAM); 需要用SPY找到控件的标识
|||
终于编出来了 WPARAM 给对应的空间handle发送消息就好了
long current); //事件 public event dDownloadProgress onDownLoadProgress; //开始模拟工作 public void Start() ...{ for (int i = 0; i < 100; i++) ...{ if (onDownLoadProgress
控制其他进程的滚动条 帮帮忙
最新推荐文章于 2026-01-01 20:14:28 发布
本文介绍了一个使用C#实现的下载类,该类通过委托和事件机制来更新UI上的下载进度。利用子线程进行下载任务,并在主线程中更新进度条,确保了UI的响应速度。
5665

被折叠的 条评论
为什么被折叠?



