<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>.Net Extremo &#187; Progresos</title>
	<atom:link href="http://acollado.wordpress.com/tag/progresos/feed/" rel="self" type="application/rss+xml" />
	<link>http://acollado.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 12 Oct 2009 19:56:43 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>es</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='acollado.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/284f0b0cc5215cefbd5947b3a2af8361?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>.Net Extremo &#187; Progresos</title>
		<link>http://acollado.wordpress.com</link>
	</image>
			<item>
		<title>Mostrar progresos con BackgroundWorker</title>
		<link>http://acollado.wordpress.com/2008/05/11/mostrar-progresos-con-backgroundworker/</link>
		<comments>http://acollado.wordpress.com/2008/05/11/mostrar-progresos-con-backgroundworker/#comments</comments>
		<pubDate>Sun, 11 May 2008 20:46:52 +0000</pubDate>
		<dc:creator>acollado</dc:creator>
				<category><![CDATA[Piensa en asíncrono]]></category>
		<category><![CDATA[asíncrono]]></category>
		<category><![CDATA[BackgroundWorker]]></category>
		<category><![CDATA[Componente]]></category>
		<category><![CDATA[Progresos]]></category>

		<guid isPermaLink="false">http://acollado.wordpress.com/?p=28</guid>
		<description><![CDATA[Cuando necesitamos realizar tareas de manera asíncrona El .Net Framework nos proporciona varias opciones;
-Mediante la clase  Thread.
-Mediante delegados asíncronos.
-Mediante el componente BackgroundWorker.
Se me ocurren diversas situaciones en la que cada uno puede ser más apropiado. Pero, si lo que queremos es mostrar el progreso de la tarea, la mejor opción es el componente BackgroundWorker. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acollado.wordpress.com&blog=3657593&post=28&subd=acollado&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div class="Section1">Cuando necesitamos realizar tareas de manera asíncrona El .Net Framework nos proporciona varias opciones;<br />
-Mediante la clase  <strong><span style="font-size:10pt;line-height:115%;">Thread</span></strong><span style="font-size:10pt;line-height:115%;">.<br />
</span>-Mediante <a href="http://acollado.wordpress.com/2008/05/10/delegados-genericos/">delegados</a> asíncronos.<br />
-Mediante el componente BackgroundWorker.<br />
Se me ocurren diversas situaciones en la que cada uno puede ser más apropiado. Pero, si lo que queremos es mostrar el progreso de la tarea, la mejor opción es el componente BackgroundWorker. El componente BackgroundWorker tiene varias características que le hacen interesante; como puede ser la notificación del progreso  y notificación de cancelación.<br />
El ejemplo de código siguiente es un modo sencillo de dar soporte para cancelación y notificación del progreso de una tarea asíncrona.</p>
<table class="MsoTableColorfulGridAccent3" style="border-collapse:collapse;height:18px;" border="0" cellspacing="0" cellpadding="0" width="682">
<tbody>
<tr>
<td style="background:#d6e3bc none repeat scroll 0 50%;width:432.2pt;padding:0 5.4pt;" width="660" valign="top"><span style="color:#339966;">Nota:<br />
Este componente solo está disponible   desde la versión 2.0 del Framework.</span></td>
</tr>
</tbody>
</table>
<p class="MsoNormal">
<p>Lo primero es arrastrar el componente a nuestra aplicación</p>
<p><img src="http://acollado.files.wordpress.com/2008/05/backgroundworker.jpg" alt="" /></p>
<p>Una vez que los hemos situado en el área de trabajo configuramos las siguientes propiedades:</p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;">WorkerReportsProgress = <span style="color:blue;">true<br />
</span>WorkerSupportsCancellation=<span style="color:blue;">true </span></span>(solo en caso de querer dar soporte para cancelación)</p>
<p>Ahora definimos los eventos de cancelación, notificación y trabajo.</p>
<p>DoWork: Este evento es disparado al comienzo de la operación asíncrona y sera donde realicemos las tareas.</p>
<p>ProgressChanged: Este evento será disparado el notificar un progreso al componente.</p>
<p>RunWorkerCompleted: Este evento será disparado al terminar la operación asíncrona.</p>
<table class="MsoTableColorfulGridAccent3" style="border-collapse:collapse;margin-left:5.1pt;margin-right:5.1pt;" border="0" cellspacing="0" cellpadding="0" align="left">
<tbody>
<tr>
<td style="background:#d6e3bc none repeat scroll 0 50%;width:432.2pt;padding:0 5.4pt;" width="660" valign="top"><span style="color:#339966;">Nota:<br />
Si desea acceder a un control desde la operación que este realizando el componente BackgroundWorker. Por ejemplo,   mostrar el estado de progreso en un control Label, es más que aconsejable   hacerlo desde el evento ProgressChanged, ya que la aplicación podria   comportarse de forma inesperada.</span></td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p>Ya podemos escribir el código que sera lanzado con cada evento.</p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><strong>C#</strong><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;">private</span><span style="font-size:10pt;"> <span style="color:blue;">void</span> bwProgress_DoWork(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">DoWorkEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> {</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">for</span> (<span style="color:blue;">int</span> i = 1; i &lt;= 100; i++)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> {</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">//Realiza una tarea</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> System.Threading.<span style="color:#2b91af;">Thread</span>.Sleep(100); </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> bwProgress.ReportProgress(i);</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">if</span><span style="font-size:10pt;"> (bwProgress.CancellationPending)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">return</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> }</span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;line-height:115%;"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;">private</span><span style="font-size:10pt;"> <span style="color:blue;">void</span> bwProgress_ProgressChanged(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">ProgressChangedEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">{</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">//Notificar el progreso de la tarea</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">progressBar1.Value = e.ProgressPercentage;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> lblInfo.Text = e.ProgressPercentage + <span style="color:#a31515;">&#8220;%&#8221;</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span><span style="font-size:10pt;line-height:115%;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;">private</span><span style="font-size:10pt;"> <span style="color:blue;">void</span> bwProgress_RunWorkerCompleted(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">RunWorkerCompletedEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">{</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">//Realizamos las operaciones que haya que realizar al terminar el progreso</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">lblInfo.Text = <span style="color:#a31515;">&#8220;Tarea terminada&#8221;</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnCancelar.Enabled = <span style="color:blue;">false</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnIniciar.Enabled = <span style="color:blue;">true</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> progressBar1.Value = 0;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> }</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;">private</span><span style="font-size:10pt;"> <span style="color:blue;">void</span> btnIniciar_Click(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">EventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">{</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">//Iniciamos el trabajo</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">if</span> (!bwProgress.IsBusy)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">{</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> bwProgress.RunWorkerAsync();</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnCancelar.Enabled = <span style="color:blue;">true</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnIniciar.Enabled = <span style="color:blue;">false</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> }</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> }</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;">private</span><span style="font-size:10pt;"> <span style="color:blue;">void</span> btnCancelar_Click(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">EventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">{</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">//Solicitamos la cancelación de la operación</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">bwProgress.CancelAsync();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> }</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><strong><span style="font-size:10pt;">VB</span></strong><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;line-height:115%;"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;">Private</span><span style="font-size:10pt;"> <span style="color:blue;">Sub</span> bwProgress_DoWork(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> System.Object, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.ComponentModel.DoWorkEventArgs) <span style="color:blue;">Handles</span> bwProgress.DoWork</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">For</span> i <span style="color:blue;">As</span> <span style="color:blue;">Integer</span> = 1 <span style="color:blue;">To</span> 100</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">&#8221;Realiza una tarea</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> System.Threading.Thread.Sleep(100)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> bwProgress.ReportProgress(i)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">If</span> (bwProgress.CancellationPending) <span style="color:blue;">Then</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">Return</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">End</span> <span style="color:blue;">If</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">Next</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">End</span> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;">Private</span><span style="font-size:10pt;"> <span style="color:blue;">Sub</span> bwProgress_ProgressChanged(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> System.Object, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.ComponentModel.ProgressChangedEventArgs) <span style="color:blue;">Handles</span> bwProgress.ProgressChanged</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">&#8216;Notificar el progreso de la tarea</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">progressBar1.Value = e.ProgressPercentage</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> lblInfo.Text = e.ProgressPercentage + <span style="color:#a31515;">&#8220;%&#8221;</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">End</span> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;">Private</span><span style="font-size:10pt;"> <span style="color:blue;">Sub</span> bwProgress_RunWorkerCompleted(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> System.Object, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.ComponentModel.RunWorkerCompletedEventArgs) <span style="color:blue;">Handles</span> bwProgress.RunWorkerCompleted</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">&#8221;Realizamos las operaciones que haya que realizar al terminar el progreso</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">lblInfo.Text = <span style="color:#a31515;">&#8220;Tarea terminada&#8221;</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnCancelar.Enabled = <span style="color:blue;">False</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnIniciar.Enabled = <span style="color:blue;">True</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> progressBar1.Value = 0</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;">End</span><span style="font-size:10pt;line-height:115%;"> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;">Private</span><span style="font-size:10pt;"> <span style="color:blue;">Sub</span> btnIniciar_Click(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> System.Object, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.EventArgs) <span style="color:blue;">Handles</span> btnIniciar.Click</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:green;">&#8221;Iniciamos el trabajo</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">If</span> (<span style="color:blue;">Not</span> bwProgress.IsBusy) <span style="color:blue;">Then</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> bwProgress.RunWorkerAsync()</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnCancelar.Enabled = <span style="color:blue;">True</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> btnIniciar.Enabled = <span style="color:blue;">False</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> <span style="color:blue;">End</span> <span style="color:blue;">If</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;">End</span><span style="font-size:10pt;line-height:115%;"> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;">Private</span><span style="font-size:10pt;"> <span style="color:blue;">Sub</span> btnCancelar_Click(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> System.Object, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.EventArgs) <span style="color:blue;">Handles</span> btnCancelar.Click</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> </span><span style="font-size:10pt;">&#8216;Solicitamos la cancelación de la operación</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;"> bwProgress.CancelAsync()</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;">End</span><span style="font-size:10pt;line-height:115%;"> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal">
<p><img src="http://acollado.files.wordpress.com/2008/05/backgroundworkerprogress.jpg" alt="" /></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p>Como hemos podido ver, el código es sencillo. Con unas pocas lineas podremos dar soporte estable a nuestras operaciones asíncronas.</p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;line-height:115%;"> </span></strong></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p class="MsoNormal">
<p class="MsoNormal">
</div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/acollado.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/acollado.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/acollado.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/acollado.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/acollado.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/acollado.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/acollado.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/acollado.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/acollado.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/acollado.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/acollado.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/acollado.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acollado.wordpress.com&blog=3657593&post=28&subd=acollado&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://acollado.wordpress.com/2008/05/11/mostrar-progresos-con-backgroundworker/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f2870ea16cef0e78fd4be56eaadcc37e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">acollado</media:title>
		</media:content>

		<media:content url="http://acollado.files.wordpress.com/2008/05/backgroundworker.jpg" medium="image" />

		<media:content url="http://acollado.files.wordpress.com/2008/05/backgroundworkerprogress.jpg" medium="image" />
	</item>
	</channel>
</rss>