<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8275282278346978478</id><updated>2024-09-01T01:48:27.387-07:00</updated><category term="winform"/><category term="CheckBox"/><category term="Crystal Reports"/><category term="TreeView"/><category term="array"/><category term="cadena"/><category term="dataset"/><category term="fila"/><category term="gridview"/><category term="html"/><category term="infragistics"/><category term="pintar"/><category term="reporte"/><category term="ultragridview"/><title type='text'>.Net Programación Fácil</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnetsencillo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8275282278346978478/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://dotnetsencillo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Johnny Points</name><uri>http://www.blogger.com/profile/13105837679861979723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8275282278346978478.post-4483246971199321916</id><published>2011-09-23T10:37:00.000-07:00</published><updated>2011-09-23T10:37:17.147-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="array"/><category scheme="http://www.blogger.com/atom/ns#" term="cadena"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="winform"/><title type='text'>[WinForm] - Eliminar codigo html de texto</title><content type='html'>Buen Día a todos! este es un pequeño y práctico ejercicio de como eliminar por ejemplo las etiquetas&amp;nbsp;&lt;b&gt;&amp;lt;b&amp;gt;&lt;/b&gt; y &lt;b&gt;&amp;lt;/b&amp;gt;&lt;/b&gt;&amp;nbsp;que vienen a ser el relleno Negrita que hace algún tiempo ayude a un usuario solicitando esto y me pareció adecuado postearlo en el blog. Como podrán observar se hace un recorrido de toda la cadena :&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6; font-size: large;&quot;&gt;&lt;u&gt;Codigo VB.NET :&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-clip: initial; background-origin: initial; background-position: 3px 3px; border-bottom: rgb(204,204,204) 1px dashed; border-left: rgb(204,204,204) 1px dashed; border-right: rgb(204,204,204) 1px dashed; border-top: rgb(204,204,204) 1px dashed; margin: 5px 0px; padding-bottom: 8px; padding-left: 36px; padding-right: 12px; padding-top: 8px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Dim &lt;/span&gt;nuevaCadena &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;As String&lt;/span&gt; = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;&quot;&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; s &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;as String&lt;/span&gt; = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;&amp;lt;b&amp;gt;Programacion &amp;lt;/b&amp;gt;.Net &amp;lt;b&amp;gt;Facil&amp;lt;/b&amp;gt;, verdad &amp;lt;b&amp;gt;que &amp;lt;/b&amp;gt;es &amp;lt;b&amp;gt;facil&amp;lt;/b&amp;gt;? =)&quot;&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; a &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;As Char&lt;/span&gt;() = s.ToCharArray
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Dim &lt;/span&gt;cont &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;As Integer&lt;/span&gt; = 0
&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;For&lt;/span&gt; i &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;As Integer&lt;/span&gt; = 0 &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;To&lt;/span&gt; Label1.Text.Length - 1
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;If&lt;/span&gt; (a(i).ToString.Equals(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;&amp;lt;&quot;&lt;/span&gt;)) &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Then&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;If&lt;/span&gt; (a(i + 1).ToString.Equals(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;/&quot;&lt;/span&gt;)) &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Then&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;If&lt;/span&gt; (a(i + 2).ToString.Equals(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;b&quot;&lt;/span&gt;)) &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Then&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;If&lt;/span&gt; (a(i + 3).ToString.Equals(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;&amp;gt;&quot;&lt;/span&gt;)) &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Then&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cont = i + 4
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;End If&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;End If&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;End If&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;If&lt;/span&gt; (a(i + 1).ToString.Equals(&quot;b&quot;)) &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Then&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;If &lt;/span&gt;(a(i + 2).ToString.Equals(&quot;&amp;gt;&quot;)) &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Then&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cont = i + 3
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;End If&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;End If
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;If&lt;/span&gt; (i &amp;gt;= cont) &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Then&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nuevaCadena = nuevaCadena &amp;amp; a(i).ToString
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;End If
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.show(nuevaCadena)
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Original :&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Programacion &lt;/b&gt;.Net &lt;b&gt;Facil&lt;/b&gt;, verdad &lt;b&gt;que &lt;/b&gt;es &lt;b&gt;facil&lt;/b&gt;? =) --&amp;gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&amp;lt;b&amp;gt;Programacion &amp;lt;/b&amp;gt;.Net &amp;lt;b&amp;gt;Facil&amp;lt;/b&amp;gt;, verdad &amp;lt;b&amp;gt;que &amp;lt;/b&amp;gt;es &amp;lt;b&amp;gt;facil&amp;lt;/b&amp;gt;? =)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Resultado :&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;Programacion .Net Facil,verdad que es facil? =)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;Espero les haya sido de utilidad. Saludos!.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetsencillo.blogspot.com/feeds/4483246971199321916/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://dotnetsencillo.blogspot.com/2011/09/winform-eliminar-codigo-html-de-texto.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8275282278346978478/posts/default/4483246971199321916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8275282278346978478/posts/default/4483246971199321916'/><link rel='alternate' type='text/html' href='http://dotnetsencillo.blogspot.com/2011/09/winform-eliminar-codigo-html-de-texto.html' title='[WinForm] - Eliminar codigo html de texto'/><author><name>Johnny Points</name><uri>http://www.blogger.com/profile/13105837679861979723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8275282278346978478.post-5949974947499050314</id><published>2011-09-23T10:36:00.000-07:00</published><updated>2011-09-23T10:36:45.300-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="winform"/><title type='text'>[WinForm] - Ejecutar Aplicación al Iniciar Windows</title><content type='html'>Buen Día a todos! En esta oportunidad se verá cómo ejecutar una&amp;nbsp;aplicación&amp;nbsp;al iniciar windows mediante los registros, para comenzar debemos crear 2 botones(uno llamado &lt;b&gt;btnInicio &lt;/b&gt;y otro &lt;b&gt;btnNoInicio&lt;/b&gt;) y 3 variables en el formulario e indexarles los valores en el evento &lt;b&gt;load &lt;/b&gt;del formulario, en el evento &lt;b&gt;Click&lt;/b&gt; del boton, donde 1 es para obtener el nombre del exe que se ejecuta y el otro para obtener su ruta y luego llamar &amp;nbsp;al metodo :&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6; font-size: large;&quot;&gt;Codigo c#&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-clip: initial; background-origin: initial; background-position: 3px 3px; border-bottom: rgb(204,204,204) 1px dashed; border-left: rgb(204,204,204) 1px dashed; border-right: rgb(204,204,204) 1px dashed; border-top: rgb(204,204,204) 1px dashed; margin: 5px 0px; padding-bottom: 8px; padding-left: 36px; padding-right: 12px; padding-top: 8px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//Variables&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;lbl = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;&quot;&lt;/span&gt;;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;path = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;&quot;&lt;/span&gt;;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//NombreApp será el identificador en el registro&lt;/span&gt;

&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;nombreApp = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;&quot;&lt;/span&gt;;&lt;/div&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;pre style=&quot;background-clip: initial; background-origin: initial; background-position: 3px 3px; border-bottom: rgb(204,204,204) 1px dashed; border-left: rgb(204,204,204) 1px dashed; border-right: rgb(204,204,204) 1px dashed; border-top: rgb(204,204,204) 1px dashed; margin: 5px 0px; padding-bottom: 8px; padding-left: 36px; padding-right: 12px; padding-top: 8px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//Evento load del formulario&lt;/span&gt;

&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;private void &lt;/span&gt;Formulario_Load(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;object &lt;/span&gt;sender, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;EventArgs &lt;/span&gt;e)
{
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;lbl = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Path&lt;/span&gt;.GetFileName(System.Reflection.&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Assembly&lt;/span&gt;.GetExecutingAssembly().GetName().CodeBase);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; path = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Path&lt;/span&gt;.GetDirectoryName(System.Reflection.&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Assembly&lt;/span&gt;.GetExecutingAssembly().GetName().CodeBase).Remove(0, 6) + &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;\\&quot;&lt;/span&gt; + lbl;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;nombreApp = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;MiAplicacion&quot;&lt;/span&gt;;
}
&lt;/pre&gt;&lt;br /&gt;
Ahora en el&amp;nbsp;botón&amp;nbsp;&lt;b&gt;btnInicio &lt;/b&gt;realizaremos el siguiente&amp;nbsp;código&amp;nbsp;:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-clip: initial; background-origin: initial; background-position: 3px 3px; border-bottom: rgb(204,204,204) 1px dashed; border-left: rgb(204,204,204) 1px dashed; border-right: rgb(204,204,204) 1px dashed; border-top: rgb(204,204,204) 1px dashed; margin: 5px 0px; padding-bottom: 8px; padding-left: 36px; padding-right: 12px; padding-top: 8px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;// Resgistrará en Inicio del registro la aplicación indicada
// Devuelve True si todo fue bien, False en caso contrario
// Guardar la clave en el registro
// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;try&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;RegistryKey&lt;/span&gt; runK = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Registry&lt;/span&gt;.LocalMachine.OpenSubKey(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;@&quot;Software\Microsoft\Windows\CurrentVersion\Run&quot;&lt;/span&gt;, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;// añadirlo al registro
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Si el path contiene espacios se debería incluir entre comillas dobles&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (nombreApp.StartsWith(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;\&quot;&quot;&lt;/span&gt;) == &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;false &lt;/span&gt;&amp;amp;&amp;amp; nombreApp.IndexOf(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot; &quot;&lt;/span&gt;) &amp;gt; -1)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nombreApp =&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt; &quot;\&quot;&quot;&lt;/span&gt; + nombreApp +&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt; &quot;\&quot;&quot;&lt;/span&gt;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; runK.SetValue(path, nombreApp);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;return true&lt;/span&gt;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;catch &lt;/span&gt;(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Exception &lt;/span&gt;ex)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;ERROR al guardar en el registro.{0}Seguramente no tienes privilegios suficientes.{0}{1}{0}---xxx---{2}&quot;&lt;/span&gt;, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&#39;\n&#39;&lt;/span&gt;, ex.Message, ex.StackTrace);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;/pre&gt;&lt;br /&gt;
Y finalmente en el boton &lt;b&gt;btnNoInicio &lt;/b&gt;el siguiente codigo :&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-clip: initial; background-origin: initial; background-position: 3px 3px; border-bottom: rgb(204,204,204) 1px dashed; border-left: rgb(204,204,204) 1px dashed; border-right: rgb(204,204,204) 1px dashed; border-top: rgb(204,204,204) 1px dashed; margin: 5px 0px; padding-bottom: 8px; padding-left: 36px; padding-right: 12px; padding-top: 8px;&quot;&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;// Quitará de Inicio la aplicación indicada
&amp;nbsp;// Devuelve True si todo fue bien, False en caso contrario
&amp;nbsp;// Si la aplicación no estaba en Inicio, devuelve True salvo que se produzca un error&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;try&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;RegistryKey &lt;/span&gt;runK = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Registry&lt;/span&gt;.LocalMachine.OpenSubKey(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;@&quot;Software\Microsoft\Windows\CurrentVersion\Run&quot;&lt;/span&gt;, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt; // quitar la clave indicada del registo&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; runK.DeleteValue(path, false);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;return true&lt;/span&gt;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;catch &lt;/span&gt;(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Exception &lt;/span&gt;ex)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&quot;ERROR al eliminar la clave del registro.{0}Seguramente no tienes privilegios suficientes.{0}{1}{0}---xxx---{2}&quot;&lt;/span&gt;, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&#39;\n&#39;&lt;/span&gt;, ex.Message, ex.StackTrace);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; return false&lt;/span&gt;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;/pre&gt;&lt;br /&gt;
Espero les haya sido útil. Saludos!.</content><link rel='replies' type='application/atom+xml' href='http://dotnetsencillo.blogspot.com/feeds/5949974947499050314/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://dotnetsencillo.blogspot.com/2011/09/winform-ejecutar-aplicacion-al-iniciar.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8275282278346978478/posts/default/5949974947499050314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8275282278346978478/posts/default/5949974947499050314'/><link rel='alternate' type='text/html' href='http://dotnetsencillo.blogspot.com/2011/09/winform-ejecutar-aplicacion-al-iniciar.html' title='[WinForm] - Ejecutar Aplicación al Iniciar Windows'/><author><name>Johnny Points</name><uri>http://www.blogger.com/profile/13105837679861979723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8275282278346978478.post-1482160292436312841</id><published>2011-09-23T10:35:00.001-07:00</published><updated>2011-09-23T10:35:23.857-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="fila"/><category scheme="http://www.blogger.com/atom/ns#" term="infragistics"/><category scheme="http://www.blogger.com/atom/ns#" term="pintar"/><category scheme="http://www.blogger.com/atom/ns#" term="ultragridview"/><title type='text'>[Infragistics] - Pintar Filas de un UltraGridView</title><content type='html'>Buen Día a Todos! en esta ocasión les enseñaremos como pintar aquellas filas  según el contenido para un &lt;b&gt;UltraGridView&lt;/b&gt;, para tal efecto pintaremos  aquellas filas que tengan como contenido &lt;b&gt;&quot;Anulado&quot;.&lt;/b&gt;&amp;nbsp;Esto se realizará en  el evento&amp;nbsp;&lt;b&gt;InitializeRow&lt;/b&gt;&amp;nbsp;que es el momento en que las filas se inicializan  y es&amp;nbsp;aquí&amp;nbsp;donde daremos el pintado de nuestro objetivo :&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6; font-size: large;&quot;&gt;&lt;b&gt;Codigo VB.NET  :&lt;/b&gt;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-clip: initial; background-origin: initial; background-position: 3px 3px; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; margin-bottom: 5px; margin-top: 5px; padding-bottom: 8px; padding-left: 36px; padding-right: 12px; padding-top: 8px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px; white-space: normal;&quot;&gt;&lt;pre class=&quot;brush:vbnet&quot; id=&quot;code-result&quot; style=&quot;font-size: 12px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Private Sub&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt; MiUltraGrid_InitializeRow(sender &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;As Object&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt;, e &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;As&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt; Infragistics.Win.UltraWinGrid.InitializeRowEventArgs)&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px; white-space: normal;&quot;&gt;&lt;pre class=&quot;brush:vbnet&quot; id=&quot;code-result&quot; style=&quot;font-size: 12px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&#39;Si el contenido de la columna estado es igual a ANULADO&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px; white-space: normal;&quot;&gt;&lt;pre class=&quot;brush:vbnet&quot; id=&quot;code-result&quot; style=&quot;font-size: 12px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;If&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt; e.Row.Cells(&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e69138;&quot;&gt;&quot;ESTADO&quot;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt;).Value.ToString().Trim() = &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e69138;&quot;&gt;&quot;ANULADO&quot;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt; Then&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px; white-space: normal;&quot;&gt;&lt;pre class=&quot;brush:vbnet&quot; id=&quot;code-result&quot; style=&quot;font-size: 12px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&#39;Escojo 2 colores&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px; white-space: normal;&quot;&gt;&lt;pre class=&quot;brush:vbnet&quot; id=&quot;code-result&quot; style=&quot;font-size: 12px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt;  e.Row.Appearance.BackColor = &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt;.White
  e.Row.Appearance.BackColor2 = &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt;.Pink&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px; white-space: normal;&quot;&gt;&lt;pre class=&quot;brush:vbnet&quot; id=&quot;code-result&quot; style=&quot;font-size: 12px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&#39;Y doy el efecto degradado vertical&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px; white-space: normal;&quot;&gt;&lt;pre class=&quot;brush:vbnet&quot; id=&quot;code-result&quot; style=&quot;font-size: 12px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt;  e.Row.Appearance.BackGradientStyle = Infragistics.Win.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;GradientStyle&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2e2e2e;&quot;&gt;.VerticalBump
 &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;End If
End Sub&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6; font-size: large;&quot;&gt;Codigo C#  :&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-clip: initial; background-origin: initial; background-position: 3px 3px; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; margin-bottom: 5px; margin-top: 5px; padding-bottom: 8px; padding-left: 36px; padding-right: 12px; padding-top: 8px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;private void&lt;/span&gt; MiUltraGrid_InitializeRow(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;object &lt;/span&gt;sender, Infragistics.Win.UltraWinGrid.&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;InitializeRowEventArgs &lt;/span&gt;e)
        {
           &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #6aa84f;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//Si el contenido de la columna estado es igual a ANULADO&lt;/span&gt;
            &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (e.Row.Cells[&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e69138;&quot;&gt;&quot;ESTADO&quot;&lt;/span&gt;].Value.ToString().Trim() == &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e69138;&quot;&gt;&quot;ANULADO&quot;&lt;/span&gt;)
            {
               &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt; //Escojo 2 colores&lt;/span&gt;
                e.Row.Appearance.BackColor = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Color&lt;/span&gt;.White;
                e.Row.Appearance.BackColor2 = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Color&lt;/span&gt;.Pink;
                &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//Y doy el efecto degradado vertical&lt;/span&gt;
                e.Row.Appearance.BackGradientStyle = Infragistics.Win.&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;GradientStyle&lt;/span&gt;.VerticalBump;
            }
        }
&lt;/pre&gt;&lt;br /&gt;
Y como resultado final se obtendría lo siguiente :&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-crT0_mrPX_c/ThIa7kZ3U2I/AAAAAAAAAGQ/oEIYdGVxeu4/s1600/grilla.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-crT0_mrPX_c/ThIa7kZ3U2I/AAAAAAAAAGQ/oEIYdGVxeu4/s1600/grilla.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
Espero les haya sido&amp;nbsp;útil. Saludos!.</content><link rel='replies' type='application/atom+xml' href='http://dotnetsencillo.blogspot.com/feeds/1482160292436312841/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://dotnetsencillo.blogspot.com/2011/09/infragistics-pintar-filas-de-un.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8275282278346978478/posts/default/1482160292436312841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8275282278346978478/posts/default/1482160292436312841'/><link rel='alternate' type='text/html' href='http://dotnetsencillo.blogspot.com/2011/09/infragistics-pintar-filas-de-un.html' title='[Infragistics] - Pintar Filas de un UltraGridView'/><author><name>Johnny Points</name><uri>http://www.blogger.com/profile/13105837679861979723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-crT0_mrPX_c/ThIa7kZ3U2I/AAAAAAAAAGQ/oEIYdGVxeu4/s72-c/grilla.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8275282278346978478.post-4694291254981249018</id><published>2011-09-23T10:34:00.002-07:00</published><updated>2011-09-23T10:38:48.104-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Crystal Reports"/><category scheme="http://www.blogger.com/atom/ns#" term="dataset"/><category scheme="http://www.blogger.com/atom/ns#" term="gridview"/><category scheme="http://www.blogger.com/atom/ns#" term="reporte"/><title type='text'>[Crystal Reports] - Reporte con DataSet Tipado</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Para este ejemplo haremos un Reporte de Libreta de Notas de un Colegio &quot;X&quot;,  en el cual el Dataset Tipado actuará como contenedor de los datos que se  mostrarán en el reporte, tambien pueden aplicar este ejemplo como exportación de  datos de un gridview para los detalles como las notas.&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;strong&gt;&lt;u&gt;1. Definir la estructura&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Crearemos un Dataset llamado &lt;b&gt;libreta.xds&lt;/b&gt; y aquí definiremos los datos  que se mostrarán en los reportes con los Datatables creados manualmente, en el  cual iran&amp;nbsp;algunos campos que queremos mostrar de su tabla real de vuestra  BD.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-zRB0s2uCYE0/Tg-oB3snq4I/AAAAAAAAAFk/OcIH1WcShQU/s1600/dataset.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;216&quot; i$=&quot;true&quot; src=&quot;http://1.bp.blogspot.com/-zRB0s2uCYE0/Tg-oB3snq4I/AAAAAAAAAFk/OcIH1WcShQU/s640/dataset.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;strong&gt;&lt;u&gt;2. Creación del Reporte&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Una vez&amp;nbsp;terminado el esquema de los datos se procede con el reporte, para  ello se agrega uno nuevo en el proyecto, en este caso con el nombre de  Libreta.rpt, y se configuran los datos mediante la opciones del “Field  Explorer”, agregando el origen de datos, como muestra la imagen:&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-4_Mah6U23WI/Tg-rEkrMkcI/AAAAAAAAAFo/6XVyBM-njpQ/s1600/createreport.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;312&quot; i$=&quot;true&quot; src=&quot;http://3.bp.blogspot.com/-4_Mah6U23WI/Tg-rEkrMkcI/AAAAAAAAAFo/6XVyBM-njpQ/s320/createreport.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Del cuadro de dialogo  siguiente se selecciona el DataSet creado en el paso previo llamado  &lt;strong&gt;libreta.xds&lt;/strong&gt;&amp;nbsp; y pasan las 3 tablas creadas:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-sq3jmCJnNSQ/Tg-tmOqJqMI/AAAAAAAAAFs/toT-HwQosj8/s1600/ado.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;236&quot; i$=&quot;true&quot; src=&quot;http://2.bp.blogspot.com/-sq3jmCJnNSQ/Tg-tmOqJqMI/AAAAAAAAAFs/toT-HwQosj8/s320/ado.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Por ultimo, el  asistente de Crystal permitirá redefinir como se vinculan las tablas, en este  caso por representar información a distinto nivel no existe una relación, pero  si se desarrollara algún reporte del estilo maestro-detalles, podría existir un  vinculo entre las tablas.﻿&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-efgsvPSua1Q/Tg-wqKCrKpI/AAAAAAAAAFw/UDARhVd6jMY/s1600/rel.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;202&quot; i$=&quot;true&quot; src=&quot;http://4.bp.blogspot.com/-efgsvPSua1Q/Tg-wqKCrKpI/AAAAAAAAAFw/UDARhVd6jMY/s320/rel.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;Una vez concluidos los pasos para configurar el esquema de datos del reporte,  arrastrando los campos al reporte, podría armar un reporte similar a este:&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-aqQf4VRRIAE/ThCgMlM0qVI/AAAAAAAAAF0/yv4ID8CYjdA/s1600/rpt.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;331&quot; i$=&quot;true&quot; src=&quot;http://1.bp.blogspot.com/-aqQf4VRRIAE/ThCgMlM0qVI/AAAAAAAAAF0/yv4ID8CYjdA/s640/rpt.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div align=&quot;center&quot; class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;strong&gt;&lt;u&gt;3. ﻿Carga de los datos en el DataSet&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Ahora  se creara un Formulario nuevo para que allí se muestre el reporte en una nueva  ventana como se muestra en la imagen y se inseta un reportviewer:&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-R5yhAQHJfSs/ThDadUaDG1I/AAAAAAAAAF8/gpKmhP0Yno8/s1600/rpt.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; i$=&quot;true&quot; src=&quot;http://3.bp.blogspot.com/-R5yhAQHJfSs/ThDadUaDG1I/AAAAAAAAAF8/gpKmhP0Yno8/s1600/rpt.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;pre style=&quot;background-clip: initial; background-origin: initial; background-position: 3px 3px; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; margin-bottom: 5px; margin-top: 5px; padding-bottom: 8px; padding-left: 36px; padding-right: 12px; padding-top: 8px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Imports&lt;/span&gt; CrystalDecisions.CrystalReports.Engine
&lt;span style=&quot;color: blue;&quot;&gt;Imports&lt;/span&gt; CrystalDecisions.Shared

&lt;span style=&quot;color: blue;&quot;&gt;Public Class&lt;/span&gt; Reporte

    &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; libre &lt;span style=&quot;color: blue;&quot;&gt;As New&lt;/span&gt; Libreta

    &lt;span style=&quot;color: blue;&quot;&gt;Public Sub New&lt;/span&gt;()
        InitializeComponent()
    &lt;span style=&quot;color: blue;&quot;&gt;End Sub&lt;/span&gt;

    &lt;span style=&quot;color: blue;&quot;&gt;Public Sub New&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; datos &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; Libreta)
        &lt;span style=&quot;color: blue;&quot;&gt;Me.New&lt;/span&gt;()
        libre = datos
    &lt;span style=&quot;color: blue;&quot;&gt;End Sub&lt;/span&gt;



    &lt;span style=&quot;color: blue;&quot;&gt;Private Sub&lt;/span&gt; Reporte_Load(&lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; System.Object, &lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; System.EventArgs) &lt;span style=&quot;color: blue;&quot;&gt;Handles&lt;/span&gt; MyBase.Load
        &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; path &lt;span style=&quot;color: blue;&quot;&gt;As String&lt;/span&gt; = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase.ToString()).Remove(0, 6) &amp;amp; &lt;span style=&quot;color: #b45f06;&quot;&gt;&quot;\Libreta.rpt&quot;&lt;/span&gt;
        &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; cryRPT &lt;span style=&quot;color: blue;&quot;&gt;As New&lt;/span&gt; ReportDocument
        cryRPT.Load(path)
        cryRPT.SetDataSource(libre)
        CrystalReportViewer1.ReportSource = cryRPT
        CrystalReportViewer1.Refresh()
    &lt;span style=&quot;color: blue;&quot;&gt;End Sub&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;End Class&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;div align=&quot;center&quot; class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;En esta  última parte es la codificación del llenado de datos hacia el dataset  &lt;strong&gt;Libreta.xds &lt;/strong&gt;que para tal efecto lo pueden hacer deste la clase  del formulario nuevo que vamos a crear en 1 boton como se va a hacer ahora para  no perder un poco el orden :&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-20wQk0ETxwQ/ThDa63QwaMI/AAAAAAAAAGA/ZxTkUri0BwA/s1600/rpt.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; i$=&quot;true&quot; src=&quot;http://3.bp.blogspot.com/-20wQk0ETxwQ/ThDa63QwaMI/AAAAAAAAAGA/ZxTkUri0BwA/s1600/rpt.JPG&quot; /&gt;&lt;/a&gt;﻿&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;pre style=&quot;background-clip: initial; background-origin: initial; background-position: 3px 3px; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; margin-bottom: 5px; margin-top: 5px; padding-bottom: 8px; padding-left: 36px; padding-right: 12px; padding-top: 8px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Imports&lt;/span&gt; System.Data.SqlClient
&lt;span style=&quot;color: blue;&quot;&gt;Imports&lt;/span&gt; System.Data

&lt;span style=&quot;color: blue;&quot;&gt;Public Class&lt;/span&gt; frmLibreta

    &lt;span style=&quot;color: blue;&quot;&gt;Private Sub&lt;/span&gt; btnMostrar_Click(&lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; System.Object, &lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; System.EventArgs) &lt;span style=&quot;color: blue;&quot;&gt;Handles&lt;/span&gt; btnMostrar.Click

        &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; dsLibreta &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; Libreta = &lt;span style=&quot;color: blue;&quot;&gt;Nothing&lt;/span&gt;
        &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; datos &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;New&lt;/span&gt; DataTable
        &lt;span style=&quot;color: blue;&quot;&gt;Dim &lt;/span&gt;datos2 &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;New&lt;/span&gt; DataTable
        &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; datos3 &lt;span style=&quot;color: blue;&quot;&gt;As New&lt;/span&gt; DataTable
        &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; conexion &lt;span style=&quot;color: blue;&quot;&gt;As New&lt;/span&gt; SqlConnection(&lt;span style=&quot;color: #b45f06;&quot;&gt;&quot;Data Source=xxx;Initial Catalog=base;User ID=xxx;Password=xx&quot;&lt;/span&gt;)

       &lt;span style=&quot;color: blue;&quot;&gt; Try&lt;/span&gt;
            &lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Creamos la query&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; query &lt;span style=&quot;color: blue;&quot;&gt;As String&lt;/span&gt; = &lt;span style=&quot;color: #b45f06;&quot;&gt;&quot;select id_alumno,nombre,apellido from alumnos where id_alumno = &#39;a003&#39;&quot;&lt;/span&gt;
            &lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Creamos el adaptador&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; adaptador &lt;span style=&quot;color: blue;&quot;&gt;As New&lt;/span&gt; SqlDataAdapter(query, conexion)
            &lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Abrimos la conexion&lt;/span&gt;
            conexion.Open()
           &lt;span style=&quot;color: #6aa84f;&quot;&gt; &#39;Llenamos el Datatable&lt;/span&gt;
            adaptador.Fill(datos)

            &lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Recorremos el datatable y pasamos los datos al Dataset.Se realiza
            &#39;de esta forma para que en este paso puedan extraer datos si en caso
            &#39;fuera desde un datagridview para que recorran y pasen los datos deseados&lt;/span&gt;
            dsLibreta = &lt;span style=&quot;color: blue;&quot;&gt;New&lt;/span&gt; Libreta
            &lt;span style=&quot;color: blue;&quot;&gt;For&lt;/span&gt; x&lt;span style=&quot;color: blue;&quot;&gt; As Integer&lt;/span&gt; = 0 &lt;span style=&quot;color: blue;&quot;&gt;To&lt;/span&gt; datos.Rows.Count - 1
                dsLibreta.Alumno.AddAlumnoRow(datos.Rows(x).Item(0).ToString, datos.Rows(x).Item(1).ToString, datos.Rows(x).Item(2).ToString)
            &lt;span style=&quot;color: blue;&quot;&gt;Next&lt;/span&gt;

            &lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Creamos la nueva consulta&lt;/span&gt;
            query = &lt;span style=&quot;color: #b45f06;&quot;&gt;&quot;select nroMatricula,anoCursado from matriculas where id_alumno = &#39;a003&#39;&quot;&lt;/span&gt;
            &lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Nuevo adaptador para la nueva consulta&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; adaptador2 &lt;span style=&quot;color: blue;&quot;&gt;As New&lt;/span&gt; SqlDataAdapter(query, conexion)
            &lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Llenamos&lt;/span&gt;
            adaptador2.Fill(datos2)
            &lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Recorremos y pasamos datos al dataset&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;For &lt;/span&gt;x &lt;span style=&quot;color: blue;&quot;&gt;As Integer&lt;/span&gt; = 0 &lt;span style=&quot;color: blue;&quot;&gt;To&lt;/span&gt; datos2.Rows.Count - 1
                dsLibreta.Matricula.AddMatriculaRow(datos2.Rows(x).Item(0).ToString, datos2.Rows(x).Item(1).ToString)
            &lt;span style=&quot;color: blue;&quot;&gt;Next&lt;/span&gt;

            &lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Creamos la nueva consulta&lt;/span&gt;
            query = &lt;span style=&quot;color: #b45f06;&quot;&gt;&quot;select b.descripcion,a.nota1T1,a.nota2T1,a.nota3T1,a.nota1T2,a.nota2T2,a.nota3T2,a.nota1T3,a.nota2T3,a.nota3T3,a.promedioGral from calificaciones a inner join Materias b on a.id_materia = b.id_materia where a.id_alumnos = &#39;a003&#39;&quot;&lt;/span&gt;
            &lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Nuevo adaptador para la nueva consulta&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;Dim &lt;/span&gt;adaptador3&lt;span style=&quot;color: blue;&quot;&gt; As New&lt;/span&gt; SqlDataAdapter(query, conexion)
            &lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Llenamos&lt;/span&gt;
            adaptador3.Fill(datos3)
            &lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Recorremos y pasamos datos al dataset&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;For&lt;/span&gt; x &lt;span style=&quot;color: blue;&quot;&gt;As Integer&lt;/span&gt; = 0 &lt;span style=&quot;color: blue;&quot;&gt;To&lt;/span&gt; datos3.Rows.Count - 1
                dsLibreta.Calificacion_Materia.AddCalificacion_MateriaRow(datos3.Rows(x).Item(0).ToString, datos3.Rows(x).Item(1).ToString, datos3.Rows(x).Item(2).ToString, datos3.Rows(x).Item(3).ToString, datos3.Rows(x).Item(4).ToString, datos3.Rows(x).Item(5).ToString, datos3.Rows(x).Item(6).ToString, datos3.Rows(x).Item(7).ToString, datos3.Rows(x).Item(8).ToString, datos3.Rows(x).Item(9).ToString, datos3.Rows(x).Item(10).ToString)
            &lt;span style=&quot;color: blue;&quot;&gt;Next&lt;/span&gt;

            &lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Cerramos conexion&lt;/span&gt;
            conexion.Close()

            &lt;span style=&quot;color: blue;&quot;&gt;Dim &lt;/span&gt;formulario &lt;span style=&quot;color: blue;&quot;&gt;As New&lt;/span&gt; Reporte(dsLibreta)
            formulario.Show()


       &lt;span style=&quot;color: blue;&quot;&gt; Catch&lt;/span&gt; ex &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; Exception
            MessageBox.Show(ex.Message, &lt;span style=&quot;color: #b45f06;&quot;&gt;&quot;ERROR&quot;&lt;/span&gt;, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        &lt;span style=&quot;color: blue;&quot;&gt;End Try&lt;/span&gt;


    &lt;span style=&quot;color: blue;&quot;&gt;End Sub&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;End Class&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;&lt;u&gt;RESULTADO FINAL :&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-uAWk-iNKFAg/ThDefMn88XI/AAAAAAAAAGE/wfpiisbCyU4/s1600/rpt.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;392&quot; i$=&quot;true&quot; src=&quot;http://3.bp.blogspot.com/-uAWk-iNKFAg/ThDefMn88XI/AAAAAAAAAGE/wfpiisbCyU4/s640/rpt.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp;Espero les haya sido util. Saludos!.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetsencillo.blogspot.com/feeds/4694291254981249018/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://dotnetsencillo.blogspot.com/2011/09/crystal-reports-reporte-con-dataset.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8275282278346978478/posts/default/4694291254981249018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8275282278346978478/posts/default/4694291254981249018'/><link rel='alternate' type='text/html' href='http://dotnetsencillo.blogspot.com/2011/09/crystal-reports-reporte-con-dataset.html' title='[Crystal Reports] - Reporte con DataSet Tipado'/><author><name>Johnny Points</name><uri>http://www.blogger.com/profile/13105837679861979723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-zRB0s2uCYE0/Tg-oB3snq4I/AAAAAAAAAFk/OcIH1WcShQU/s72-c/dataset.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8275282278346978478.post-8445156625260953624</id><published>2011-09-23T10:34:00.000-07:00</published><updated>2011-09-23T10:34:09.644-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CheckBox"/><category scheme="http://www.blogger.com/atom/ns#" term="TreeView"/><title type='text'>Recorrer TreeView con Checkbox e imprimir marcados.</title><content type='html'>&lt;div style=&quot;color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin: 0px 0px 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt; Buen Día a todos! Eh visto la necesidad de publicar esto debido a la gran  duda de varios usuarios de ¿Cómo recorrer un TreeView? como mínimo. Colocaré los  codigos tanto en c# como en vb para facilitarles un poco la vida,para que la  analizen y sigamos todos progresando por lo mas mínimo que sea =).&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, &#39;BitStream vera Sans&#39;, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin: 0px 0px 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt; &lt;div style=&quot;color: #555555;&quot;&gt; Bien, para comenzar debemos saber que un&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;TreeView&lt;/strong&gt;&amp;nbsp;es  una&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline;&quot;&gt;&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;colección  de nodos&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;ordenados de manera&amp;nbsp;jerárquica&lt;strong style=&quot;margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(Padre-Hijo)&lt;/strong&gt;,  es con esta definición que nos abrirá un poco la&amp;nbsp;lógica&amp;nbsp;hacia codificación,  veamos :&lt;/div&gt;&lt;div style=&quot;color: #555555;&quot;&gt; &lt;br /&gt;
&lt;/div&gt;&lt;strong style=&quot;margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #9fc5e8;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline;&quot;&gt;Código&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline;&quot;&gt;&amp;nbsp;en  VB.NET :&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin: 0px 0px 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;pre style=&quot;background-clip: initial; background-origin: initial; background-position: 3px 3px; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; margin-bottom: 5px; margin-top: 5px; padding-bottom: 8px; padding-left: 36px; padding-right: 12px; padding-top: 8px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&#39;Se Declara una colección de nodos apartir de tu Treeview
&#39;del que se va a recorrer&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; nodes &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; TreeNodeCollection = TuTreeView.Nodes
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&#39;Se recorren los nodos principales&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;For Each&lt;/span&gt; n &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; TreeNode &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;In&lt;/span&gt; nodes
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&#39;Se Declara un metodo para que recorra los hijos de los principales
&amp;nbsp; &amp;nbsp; &#39;Y los hijos de los hijos....Recorrido Total en pocas palabras
&amp;nbsp; &amp;nbsp; &#39;Para ello se envía el nodo actual para evaluar si tiene hijos&lt;/span&gt;
&amp;nbsp; &amp;nbsp; RecorrerNodos(n)
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Next&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;div style=&quot;color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin: 0px 0px 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt; * Se Declara el&amp;nbsp;método&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;“RecorrerNodos”&lt;/strong&gt;&amp;nbsp;:&lt;/div&gt;&lt;div style=&quot;color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin: 0px 0px 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;pre style=&quot;background-clip: initial; background-origin: initial; background-position: 3px 3px; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; margin-bottom: 5px; margin-top: 5px; padding-bottom: 8px; padding-left: 36px; padding-right: 12px; padding-top: 8px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Private Sub&lt;/span&gt; &lt;strong style=&quot;margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;RecorrerNodos&lt;/strong&gt;(treeNode &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; TreeNode)
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Try&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt; &#39;Si el nodo que recibimos tiene hijos se recorrerá
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;para luego verificar si esta o no checado&lt;/span&gt;
        &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;For Each&lt;/span&gt; tn &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; TreeNode &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;In&lt;/span&gt; treeNode.Nodes
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&#39;Se Verifica si esta marcado...&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;If&lt;/span&gt; tn.Checked = &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;True Then&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt; &#39;Si esta marcado mostramos el texto del nodo&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(tb.Text)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;End If&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt; &#39;Ahora hago verificacion a los hijos del nodo actual&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;
            &#39;Esta iteración no acabara hasta llegar al ultimo nodo principal&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RecorrerNodos(tn)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Next&lt;/span&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Catch&lt;/span&gt; ex &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; Exception
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(ex.ToString())
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;End Try&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;End Sub&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;margin: 0px 0px 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt; &lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0px 0px 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #9fc5e8; font-family: Verdana, &#39;BitStream vera Sans&#39;, Helvetica, sans-serif; font-size: 12px; line-height: 17px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline;&quot;&gt;Ahora  el&amp;nbsp;código&amp;nbsp;en C#.NET&lt;/span&gt;&amp;nbsp;:&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px 0px 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt; *Este&amp;nbsp;código&amp;nbsp;se puede colocar por ejemplo en el evento&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Click&amp;nbsp;&lt;/strong&gt;de  un boton :&lt;/div&gt;&lt;pre style=&quot;background-clip: initial; background-origin: initial; background-position: 3px 3px; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; margin-bottom: 5px; margin-top: 5px; padding-bottom: 8px; padding-left: 36px; padding-right: 12px; padding-top: 8px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//Se Declara una colección de nodos apartir de tu Treeview
//del que se va a recorrer&lt;/span&gt;

{
 &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;TreeNodeCollection&lt;/span&gt; nodes = TuTreeView.Nodes;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt; //Se recorren los nodos principales&lt;/span&gt;
 &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;TreeNode&lt;/span&gt; n in nodes) {
 &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt; //Se Declara un metodo para que recorra los hijos de los principales
  //Y los hijos de los hijos....Recorrido Total en pocas palabras
  //Para ello se envía el nodo actual para evaluar si tiene hijos&lt;/span&gt;
  RecorrerNodos(n);
 }
}&lt;/pre&gt;&lt;div id=&quot;code-result&quot; style=&quot;margin: 0px 0px 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt; * Se Declara el&amp;nbsp;método&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;“RecorrerNodos”&lt;/strong&gt;&amp;nbsp;:&lt;/div&gt;&lt;pre style=&quot;background-clip: initial; background-origin: initial; background-position: 3px 3px; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; margin-bottom: 5px; margin-top: 5px; padding-bottom: 8px; padding-left: 36px; padding-right: 12px; padding-top: 8px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;private void&lt;/span&gt; RecorrerNodos(&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;TreeNode&lt;/span&gt; treeNode)
{
 &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;try&lt;/span&gt; {
  &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//Si el nodo que recibimos tiene hijos se recorrerá
  //para luego verificar si esta o no checado&lt;/span&gt;
  &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;TreeNode&lt;/span&gt; tn &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; treeNode.Nodes) {
   &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//Se Verifica si esta marcado...&lt;/span&gt;
   &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (tn.Checked == &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;) {
   &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt; //Si esta marcado mostramos el texto del nodo&lt;/span&gt;
    &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;MessageBox&lt;/span&gt;.Show(tb.Text);
   }
   &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;//Ahora hago verificacion a los hijos del nodo actual
   //Esta iteración no acabara hasta llegar al ultimo nodo principal&lt;/span&gt;
   RecorrerNodos(tn);
  }
 } &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Exception&lt;/span&gt; ex) {
  &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;MessageBox&lt;/span&gt;.Show(ex.ToString());
 }
}&lt;/pre&gt;&lt;div id=&quot;code-result&quot; style=&quot;margin: 0px 0px 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt; Espero les haya sido de mucha utilidad, pues con este ejemplo pueden explotar  un poco más su&amp;nbsp;imaginación. Saludos!.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetsencillo.blogspot.com/feeds/8445156625260953624/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://dotnetsencillo.blogspot.com/2011/09/recorrer-treeview-con-checkbox-e.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8275282278346978478/posts/default/8445156625260953624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8275282278346978478/posts/default/8445156625260953624'/><link rel='alternate' type='text/html' href='http://dotnetsencillo.blogspot.com/2011/09/recorrer-treeview-con-checkbox-e.html' title='Recorrer TreeView con Checkbox e imprimir marcados.'/><author><name>Johnny Points</name><uri>http://www.blogger.com/profile/13105837679861979723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>