<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="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" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-6427703763785525312</atom:id><lastBuildDate>Sun, 01 Jun 2025 01:19:25 +0000</lastBuildDate><category>class</category><category>Array Class</category><category>Collection</category><category>DirectoryInfo</category><category>Exception</category><category>File Info</category><category>FileInfo</category><category>GAC</category><category>Inheritance</category><category>Linq</category><category>Object</category><category>StreamReader</category><category>String class</category><category>Strong Name Key</category><category>Thread</category><category>.NET Competitor JAVA</category><category>.NET Versions</category><category>ADO.NET</category><category>ASP.NET</category><category>Abstract Class and Method</category><category>Abstraction</category><category>Access Modifier</category><category>Access Object Members</category><category>Advantages of .NET</category><category>Anonymous Method</category><category>Array</category><category>ArrayList</category><category>Arrays</category><category>Assembly</category><category>Assemblyinfo</category><category>Boxing and unboxing</category><category>BreakPoint</category><category>Brief Summary of .Net Framework</category><category>Bug</category><category>Button</category><category>C#.NET</category><category>CLR</category><category>Catch Statement</category><category>Character User Interface</category><category>Class Libraries</category><category>Class Library</category><category>Class Library Architecture</category><category>Collection Initializer</category><category>Console Application</category><category>Constructor</category><category>Control Handling Windows Form</category><category>Create Directory</category><category>Create Library</category><category>Data Encapsulation</category><category>DateTime</category><category>Debug</category><category>Delegates</category><category>Delete Directory</category><category>Demo on Buttons</category><category>Destructor</category><category>Development of Form</category><category>Difference Between .NET and JAVA</category><category>Difference Between Structure and Class</category><category>Different Type of Application in .NET</category><category>DriveInfo</category><category>Enumeration</category><category>Event Handling</category><category>Event Log</category><category>Events of Buttons</category><category>Example of Inheritance</category><category>Exception Class</category><category>Exception Handling</category><category>Exception Manager</category><category>Execute .net application in command Windows</category><category>Explicity Casting</category><category>Explicity Casting Using Conversion Methods</category><category>Extension Method</category><category>FCL</category><category>Field</category><category>Field/Data Member</category><category>Finalizer Method</category><category>Finally Statement</category><category>Flow Control with Control Statements</category><category>ForEach Loop Array</category><category>Framework Architecuture</category><category>GC (Garbaga Collector)</category><category>Garbage Collector</category><category>Get DirectoryInfo</category><category>Global Assembly Cache</category><category>Graphical User Interface</category><category>Heap</category><category>Immediate Window</category><category>Implementation of Array</category><category>Implementation syntax of Control Statements</category><category>Implementing of Shared Assembly</category><category>Implicity Casting</category><category>Indexer</category><category>Interfaces</category><category>Intoduction to Object Oriented Programming</category><category>Introduction to .net Framework</category><category>JIT Compiler</category><category>Jagged Array</category><category>LINQ with Lambda Expressions</category><category>Label</category><category>Linq syntax</category><category>Linq to Arrays</category><category>List Class</category><category>Local Window</category><category>Looping Control Statements</category><category>MSIL</category><category>Manupulating Array</category><category>Maths Class</category><category>Memory Management</category><category>Method</category><category>Method Declaration</category><category>Method Overloading</category><category>Method Overriding</category><category>Modules of .net framework</category><category>Multi Catch Block</category><category>Multi Dimension Array</category><category>Multi Form</category><category>Multi Threading</category><category>Multi-Tasking</category><category>Multiple Language Supports</category><category>Multiple Main() Method</category><category>OOP</category><category>Object Initializer</category><category>Operator Overloading</category><category>Operator Procedure</category><category>Polymorphism</category><category>Print</category><category>Print Clas</category><category>Print Document Class</category><category>Program for StreamWriter</category><category>Program for string class</category><category>Program of Anonymous</category><category>Program of Collection Initializer</category><category>Program of DateTime</category><category>Program of EventLog</category><category>Program of Exception</category><category>Program of Exception Handlign</category><category>Program of FileInfo</category><category>Program of Multi-Threading</category><category>Program of Print Class</category><category>Program of Random Class</category><category>Program of Speech Translator</category><category>Program of System.Object</category><category>Program of Thread class</category><category>Progress</category><category>Properties</category><category>Properties of Button</category><category>Property</category><category>Property of Window Controls</category><category>RAM</category><category>Random Class</category><category>Readonly</category><category>Reference type</category><category>Seamless and secured environment</category><category>Security manager</category><category>Single Dimension Array</category><category>Speech Translator</category><category>Stack</category><category>Static Class</category><category>Static Constructor</category><category>Static Method</category><category>StreamWriter</category><category>Strong Key Name</category><category>Structure</category><category>System.IO</category><category>System.Object</category><category>TEXTBOX</category><category>Thread Class</category><category>Threading Architecture</category><category>Try Satement</category><category>Type Casting</category><category>Type of .NET Framework</category><category>Type of Assemblies</category><category>Type of Assembly</category><category>Type of Inheritance</category><category>Use of Array</category><category>VB.NET</category><category>Value Type</category><category>Virtual Class</category><category>WPF Application</category><category>Web Application</category><category>Web Services</category><category>Windows Appliccation</category><category>Windows Form Application</category><category>Windows Mobile Application</category><category>Windows Services</category><category>assign property value at runtime</category><category>backend tool</category><category>brief explanation about project directory</category><category>brief explanation about visual studio</category><category>component of visual studio</category><category>console application project</category><category>flexible data access</category><category>frontend tool</category><category>hardware requirement</category><category>language supported by .net framework</category><category>linq to objects</category><category>multi delegates</category><category>multi language support</category><category>named parameter</category><category>namespace</category><category>new project creation</category><category>operators</category><category>out parameter</category><category>program for Event Handling</category><category>ref parameter</category><category>sealed Class</category><category>shared Assembly</category><category>this parameter</category><category>variable scope</category><category>version</category><category>visual studio</category><category>visual studio versions</category><title>Microsoft C#.Net Tutorials</title><description></description><link>http://microsoft-csharp-net.blogspot.com/</link><managingEditor>noreply@blogger.com (fdfsdf)</managingEditor><generator>Blogger</generator><openSearch:totalResults>67</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-1517973289077513674</guid><pubDate>Tue, 08 Apr 2014 05:46:00 +0000</pubDate><atom:updated>2015-03-28T11:16:23.719-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">TEXTBOX</category><title></title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1 style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: orange;&quot;&gt;TEXTBOX CONTROL&lt;/span&gt;&lt;/h1&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;br /&gt;
Used to take any user input in the application. &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; &lt;input maxlength=&quot;120&quot; name=&quot;Textbox&quot; placeholder=&quot;TEXTBOX&quot; size=&quot;21&quot; type=&quot;text&quot; /&gt;&lt;br /&gt;
API: System.Windows.Forms.TextBox&lt;br /&gt;&lt;BR/&gt;
&lt;div class=&quot;divh1&quot;&gt;Property of TextBox&lt;/div&gt;
&lt;div&gt;
&lt;!------------------------------------TABLE----------------------------&gt;

&lt;br /&gt;
&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;

 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Property&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Name&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the name of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Text&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the displayable text of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;BackColor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the background color of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ForeColor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the foreground color of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Font&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the font style of the control‘s text.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enabled&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enables / Disables the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Visible&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Displays / Hides the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Cursor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the mouse pointer style, when it is over on the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Size&lt;/td&gt;
  &lt;td class=&quot;tdtext&quot;&gt;Specifies the Width and Height of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Location&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the X and Y co-ordinations of the control‘s position on the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;TextAlign&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies  the  position  of  the  text  in  the  control  (Left  /  Center  / Right)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Image&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the image that is to be displayed in the control along with the text.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ImageAlign&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the position of the image in the control&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;TabIndex&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the index of the control in the tab order.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ContextMenuStrip&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Contains the reference of the respective context menu control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ReadOnly&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enables / disables read-only nature of the textbox. In the read only textbox, the user can not enter any text.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MultiLine&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enables / disables multiple lines in the text box. By default, the text box will be single-line textbox.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;WordWrap&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;This is used in multi line textboxes, which automatically moves the cursor to the next line, when the current line exceeds.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Scrollbars&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enables / disables scroll bars in the textbox.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;PasswordChar&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Used to specify the password display character. Ex: *&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MaxLength&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the maximum no. of characters that can be entered in the textbox.&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;Property of Event of TextBox&lt;/div&gt;
&lt;div&gt;
&lt;!-----------------------------------TABLE-------------------------------------------&gt;

&lt;br /&gt;
&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Event&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;tdtext&quot;&gt;TextChanged&lt;/td&gt;
  &lt;td class=&quot;tdtext&quot;&gt;Executes when any character is typed / removed in the textbox.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Click&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the user clicks the control run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;DoubleClick&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the user double-clicks the control at run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MouseMove&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the mouse pointer is moves across the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MouseEnter&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the mouse pointer is focused on to the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MouseLeave&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the mouse pointer is out of the button.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;KeyPress&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when any key is pressed on the keyboard, while the focus is on the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enter&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the focus is entered into the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Leave&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the focus is out of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;Method of TextBox&lt;/div&gt;
&lt;div&gt;
&lt;!----------------------------------------TABLE------------------------------------------&gt;

&lt;br /&gt;
&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: 100px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Method&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: 500px;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Clear()&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Clears all the contents of the textbox and makes it empty&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Focus()&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Moves the focus to the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;Program for Demo Textbox&lt;/div&gt;
&lt;br/&gt;
&lt;pre class=&quot;brush:html&quot;&gt;
&amp;lt;html&amp;gt;
 &amp;lt;head&amp;gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
   window.onload = functionundefined)
   {
     document.getElementByIdundefined&amp;#039;send&amp;#039;).onclick = functionundefinede)
    {
     Name :  alertundefineddocument.getElementByIdundefined&amp;quot;name&amp;quot;).value);
     return false;
    }
   }
  &amp;lt;/script&amp;gt;
 &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
 &amp;lt;form method=&amp;quot;post&amp;quot;&amp;gt;
  &amp;lt;div align=&amp;quot;left&amp;quot;&amp;gt;
   &amp;lt;input id=&amp;quot;name&amp;quot; name=&amp;quot;name&amp;quot; type=&amp;quot;text&amp;quot; /&amp;gt;
   &amp;lt;input id=&amp;quot;send&amp;quot; name=&amp;quot;send&amp;quot; type=&amp;quot;submit&amp;quot; value=&amp;quot;send&amp;quot; /&amp;gt;
  &amp;lt;/div&amp;gt;
 &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;pre class=&quot;brush:csharp&quot;&gt;
private void btnOK_Clickundefinedobject sender, EventArgs e)
 {
  string name = txtName.Text;
  string message = name;
  lblMessage.Text = message;
  lblMessage.Visible = true;
 }
&lt;/pre&gt;

&lt;div align=&quot;center&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/04/textbox.html</link><author>noreply@blogger.com (fdfsdf)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-549415865429022079</guid><pubDate>Tue, 08 Apr 2014 05:39:00 +0000</pubDate><atom:updated>2015-01-29T10:56:37.928-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Label</category><title></title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: orange; font-size: x-large;&quot;&gt;Label Control&lt;/span&gt;&lt;/h2&gt;

&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;14404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;br/&gt;
&lt;div&gt;
&lt;div&gt;
Mainly &amp;nbsp;used &amp;nbsp;for &amp;nbsp;presentation &amp;nbsp;purpose, &amp;nbsp;to &amp;nbsp;display &amp;nbsp;a &amp;nbsp;message &amp;nbsp;or &amp;nbsp;description &amp;nbsp;to &amp;nbsp;the user.&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;API:&lt;/b&gt; System.Windows.Forms.Label&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;Properties of Label&lt;/div&gt;
&lt;div&gt;

&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;

 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Property&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Text&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the displayable text of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;BackColor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the background color of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ForeColor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the foreground color of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Font&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the font style of the control‘s text.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enabled&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enables / Disables the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Visible&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Displays / Hides the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Cursor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the mouse pointer style, when it is over on the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Size&lt;/td&gt;
  &lt;td class=&quot;tdtext&quot;&gt;Specifies the Width and Height of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Location&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the X and Y co-ordinations of the control‘s position on the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;TextAlign&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies  the  position  of  the  text  in  the  control  (Left  /  Center  / Right)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Image&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the image that is to be displayed in the control along with the text.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ImageAlign&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the position of the image in the control&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;TabIndex&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the index of the control in the tab order.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ContextMenuStrip&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Contains the reference of the respective context menu control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;AutoSize&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enables  /  disables  automatic  sizing  of  the  control,  based  on  the text.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;divh1&quot;&gt;Events of Label &lt;/div&gt;
&lt;div&gt;

&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Event&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Click&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the user clicks the control run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;DoubleClick&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the user double-clicks the control at run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MouseMove&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the mouse pointer is moves across the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MouseEnter&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the mouse pointer is focused on to the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MouseLeave&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the mouse pointer is out of the button.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;KeyPress&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when any key is pressed on the keyboard, while the focus is on the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enter&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the focus is entered into the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Leave&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the focus is out of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;br/&gt;
&lt;div align=&quot;center&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/04/label.html</link><author>noreply@blogger.com (fdfsdf)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-347184364056168592</guid><pubDate>Tue, 08 Apr 2014 05:27:00 +0000</pubDate><atom:updated>2015-01-29T10:58:22.309-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Button</category><category domain="http://www.blogger.com/atom/ns#">Events of Buttons</category><category domain="http://www.blogger.com/atom/ns#">Properties of Button</category><title></title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1 style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: orange; font-size: x-large;&quot;&gt;&lt;i&gt;Button Control&lt;/i&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;14404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;br/&gt;

&lt;div&gt;
&amp;nbsp;It is known as action based control. Executes an operation, when it is clicked. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;button type=&quot;button&quot; onclick=&quot;alert(&#39;Welcome to Microsoft C#.NET Tutorials                                    Learn C# by Your Self you need any help contact Microsoft C#.NET 4.0&#39;)&quot;&gt;Button&lt;/button&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;API:&lt;/b&gt; System.Windows.Forms.Button&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;divh1&quot;&gt;Properties of Button&lt;/div&gt;
&lt;br/&gt;
&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;

 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Property&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Name&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the name of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Text&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the displayable text of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;BackColor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the background color of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ForeColor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the foreground color of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Font&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the font style of the control‘s text.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enabled&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enables / Disables the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Visible&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Displays / Hides the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Cursor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the mouse pointer style, when it is over on the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Size&lt;/td&gt;
  &lt;td class=&quot;tdtext&quot;&gt;Specifies the Width and Height of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Location&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the X and Y co-ordinations of the control‘s position on the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;TextAlign&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies  the  position  of  the  text  in  the  control  (Left  /  Center  / Right)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Image&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the image that is to be displayed in the control along with the text.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ImageAlign&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the position of the image in the control&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;TabIndex&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the index of the control in the tab order.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ContextMenuStrip&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Contains the reference of the respective context menu control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;FlatStyle &lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies style of the button. (Flat / Popup / Standard / System).&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div class=&quot;divh1&quot;&gt;Events of Button &lt;/div&gt;
&lt;br/&gt;

&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Event&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;tdtext&quot;&gt;TextChanged&lt;/td&gt;
  &lt;td class=&quot;tdtext&quot;&gt;Executes when any character is typed / removed in the textbox.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Click&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the user clicks the control run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;DoubleClick&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the user double-clicks the control at run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MouseMove&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the mouse pointer is moves across the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MouseEnter&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the mouse pointer is focused on to the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MouseLeave&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the mouse pointer is out of the button.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;KeyPress&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when any key is pressed on the keyboard, while the focus is on the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enter&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the focus is entered into the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Leave&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the focus is out of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;/div&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;

&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/04/button.html</link><author>noreply@blogger.com (fdfsdf)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-9042269759124002450</guid><pubDate>Mon, 07 Apr 2014 18:12:00 +0000</pubDate><atom:updated>2014-04-07T23:36:40.018-07:00</atom:updated><title>C# Controls</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;color: orange; font-size: large;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;List of Windows Form Controls &lt;/span&gt;:&lt;/span&gt;&lt;/i&gt;&lt;/h2&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;ol&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/04/button.html&quot;&gt;Button&lt;/a&gt;&lt;/u&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/04/label.html&quot;&gt;Label&lt;/a&gt;&lt;/u&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/04/textbox.html&quot;&gt;TextBox&lt;/a&gt;&lt;/u&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt; &lt;/span&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;CheckBox&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt; &lt;/span&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;RadioButton,&lt;/u&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;LinkLable,&lt;/u&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;PictureBox&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;Panel&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;GroupBox&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;ListBox&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;ComboBox,&lt;/u&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;NumericUpDown,&lt;/u&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;DomainUpDown&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;Date Time Picker&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;Month Calender&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;Track Bar&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;Timer&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;Progress Bar&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;Menu Strip&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;Context Menu Strip&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;Color Dialog&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;Font Dialog&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;FolderBrowserDialog&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;OpenFileDialog&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;SaveFileDialog&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;PrintDialog&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;RichTextBox&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;NotifyIcon&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;TabControl&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;u style=&quot;color: blue; font-size: x-large; text-align: left;&quot;&gt;TreeView&lt;/u&gt;&lt;span style=&quot;color: blue; font-size: large; text-align: left;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/h2&gt;
&lt;/div&gt;
</description><link>http://microsoft-csharp-net.blogspot.com/2014/04/c-controls.html</link><author>noreply@blogger.com (fdfsdf)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-1900377491100168877</guid><pubDate>Sat, 05 Apr 2014 08:48:00 +0000</pubDate><atom:updated>2015-03-28T11:31:07.018-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Multi Form</category><title>Working With Multi Form</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;divh1&quot;&gt;Working With Multi Form&lt;/div&gt;&lt;br/&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Adding a new Form to the Project:&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;In the Solution Explorer, right click on the project and choose Add --&amp;gt; Windows Form.&lt;/li&gt;
&lt;li&gt;In the dialog box, enter the name of the new form.&lt;/li&gt;
&lt;li&gt;Then the new form will be created.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Deleting a Form from the Project:&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;In the Solution Explorer, right click on the required form, which you want to delete and click on Delete option.&lt;/li&gt;
&lt;li&gt;Click on OK for confirmation.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Changing Startup Form:&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Even, if you add multiple forms to the project, when the project is started, the Form1will be opened by default. This is called as Startup form.&lt;/li&gt;
&lt;li&gt;To &amp;nbsp;change &amp;nbsp;the &amp;nbsp;startup &amp;nbsp;form, &amp;nbsp;change &amp;nbsp;the &amp;nbsp;following &amp;nbsp;statement &amp;nbsp;with &amp;nbsp;the &amp;nbsp;required &amp;nbsp;class name in the Program class‘s Main() method.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;b&gt;Syn:&lt;/b&gt; Application.Run(new &amp;lt;form name&amp;gt;());&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Ex: &lt;/b&gt;Application.Run(new Form2());&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Invoke Forms at Run Time (Programmatically):&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;To open any form at run time programmatically, you require to create an object for the form class.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FormName obj = new FormName();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.Show()&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt;Program for Multi Form Handling &lt;/div&gt;
&lt;pre class=&quot;brush:csharp&quot;&gt;/*Form1.cs
---------------------------------------*/
 private void Form1_DoubleClick(object sender, EventArgs e)
  {
   Form2 f = new Form2();
   f.Show();
  }
&lt;/pre&gt;
&lt;div class=&quot;divh1&quot;&gt;
System.Windows.Forms.Form Class&lt;/div&gt;&lt;br/&gt;
The &lt;b&gt;System.Windows.Forms.Form&lt;/b&gt; offers few properties, methods and events for each user-defined form class.&lt;br /&gt;
&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: 100px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Method&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: 500px;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Name&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies the name of the form class.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Text&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies the title bar text of the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;ShowIcon&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies whether the form icon is to be displayed or not.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;ShowInTaskBar&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies whether the task bar icon is to be displayed or not.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;MinimizeBox&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies whether the minimize button is to be displayed or not.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;MaximizeBox&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies whether the maximize button is to be displayed or not.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;HelpButton&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Displays / hides the ? button in the form title bar.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;ControlBox&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies  whether  the  control  box  is  to  be  displayed  or  not.  Here 
the control box means minimize, maximize and close buttons.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Enabled&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Activates / Deactivates the functionality of the entire form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;AutoScroll&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Enables / Disables automatic activation of scrollbars in the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;TopMost&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Enables / Disables automatic activation of scrollbars in the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;TopMost&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Activates / de-activates the nature of &quot;Always on top&quot;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;IsMDIContainer&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;When it is true, the form acts as Parent form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;BackColor&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies the background color of the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;ForeColor&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies default foreground color for all the controls of this form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Font&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies default font for all the controls of this form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;BackgroundImage&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies  the  background  image  of  the  form.  It  requires  an  image file of any image format.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;BackgroundImageLayout&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies  mode  of  the  background  image.  (None  /  Tile  /  Center  / 
Stretch / Zoom)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Icon&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies  the  icon  of  the  form,  displayed  at  left  most  side  of  the form title bar. It equires icon file with &quot;.ico&quot; file.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;WindowState&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies  the  status  of  the  form  window.  (Normal  /  Minimized  / Maximized)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Cursor&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies the mouse cursor style. (Arrow, Hand etc.)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;FormBorderStyle&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;None  /  FixedSingle  /  Fixed3D  /  FixedDialog  /  Sizable  / FixedToolWindow / SizableToolWindow&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Size (Width and Heght)&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies the size of the form (pixels format).&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Location (X and Y)&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies the position of the form (pixels format).&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Opacity&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Specifies form graphics depth percentage. (1% to 100%)&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br/&gt;
Syntax to access the Properties at run time: this.Property = value;&lt;br/&gt;
While you are changing the property values, you remember and follow the following syntaxes:&lt;br/&gt;
&lt;/div&gt;

&lt;div class=&quot;divh1&quot;&gt;Assign Property value at runtime in Window Form Class&lt;/div&gt;
&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: 100px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Property&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: 500px;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;Statement to assign the value at run time&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Name&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Not possible to change at run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Text&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.Text = &quot;xxxxxxxxxx&quot;;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;ShowIcon&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.ShowIcon = true / false;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;ShowInTaskBar&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.ShowInTaskbar = true / false;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;MinimizeBox&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.MinimizeBox = true / false;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;MaximizeBox&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.MaximizeBox = true / false;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;HelpButton&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.HelpButton = true / false;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;ControlBox&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.ControlBox = true / false;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Enabled&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.Enabled = true / false;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;AutoScroll&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.AutoScroll = true / false;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;TopMost&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.TopMost = true / false;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;IsMDIContainer&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.IsMdiContainer = true / false;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;BackColor&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.BackColor = System.Drawing.Color.xxxxxxx;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;ForeColor&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.ForeColor = System.Drawing.Color.xxxxxxx;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Font&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.Font = new System.Drawing.Font(&quot;font name&quot;, size);&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;BackgroundImage&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.BackgroundImage = System.Drawing.Image.FromFile(&quot;image file 
path&quot;);&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;BackgroundImageLayout&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.xxxxx&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Icon&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.Icon = new System.Drawing.Icon(&quot;icon file path&quot;);&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;WindowState&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.WindowState = System.Windows.Forms.FormWindowState.Normal;
(or)
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
(or)
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Cursor&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.Cursor = System.Windows.Forms.Cursors.xxxxx;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;FormBorderStyle&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.xxxxx;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Size (Width and Heght)&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.Size = new System.Drawing.Size(width, height);&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Location (X and Y)&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.Location = new System.Drawing.Point(x, y);&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Opacity&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;this.Opacity = n;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div class=&quot;divh1&quot;&gt;Methods of “System.Windows.Forms.Form” Class&lt;/div&gt;&lt;br/&gt;
&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: 100px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Property&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: 500px;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Hide()&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Makes the form invisible at run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Show()&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Makes the form visible at run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Close()&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Closes the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
Syntax to access the Methods in the code: this.Method();&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;divh1&quot;&gt;Events of “System.Windows.Forms.Form” Class&lt;/div&gt;&lt;br/&gt;
&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: 100px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Method&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: 500px;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Load&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes whenever the form is loaded in the memory at run time, before the form is displayed on the screen.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Shown&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes after the form is displayed on the screen.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;FormClosing&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes when the form is about to be closed.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;FormClosed&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes after the form is closed.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Click&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes when the user clicks on the form at run time&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;DoubleClick&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes when the user double-clicks on the form at run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;MouseMove&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes when the mouse pointer is moves across the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;MouseEnter&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes when the mouse pointer is focused on to the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;MouseLeave&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes when the mouse pointer is out of the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Move&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes when the form is moved at run time, using keyboard or mouse.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Resize&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes when the form is resized at run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;KeyPress&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes when any key is pressed on the keyboard, while running on the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Enter&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes when the focus is got into the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;height: auto; width: 100px;&quot;&gt;Leave&lt;/td&gt;
  &lt;td style=&quot;height: auto; width: 500px;&quot;&gt;Executes when the focus is out of the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div class=&quot;divh1&quot;&gt;Program for Windows Form Events&lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
private void Form1_Loadundefinedobject sender, EventArgs e)
  {
  this.Text = &amp;quot;This is load event.&amp;quot;;
  }
  private void Form1_Moveundefinedobject sender, EventArgs e)
  {
   this.Text = &amp;quot;This is move event.&amp;quot;;
  }
  private void Form1_Clickundefinedobject sender, EventArgs e)
   {
    this.Text = &amp;quot;This is click event.&amp;quot;;
   }
  private void Form1_DoubleClickundefinedobject sender, EventArgs e)
   {
    this.Text = &amp;quot;This is double click event.&amp;quot;;
   }
  private void Form1_FormClosedundefinedobject sender, FormClosedEventArgs e)
   {
    MessageBox.Showundefined&amp;quot;Bye. Thank you.&amp;quot;);
   }
  private void Form1_Resizeundefinedobject sender, EventArgs e)
   {
    this.Text = &amp;quot;This is resize event.&amp;quot;;
   }
  private void Form1_KeyPressundefinedobject sender, KeyPressEventArgs e)
   {
    this.Text = &amp;quot;This is key press event.&amp;quot;;
   } 
&lt;/pre&gt;
&lt;div class=&quot;divh1&quot;&gt;Program for Window Form Properties &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
private void Form1_Clickundefinedobject sender, EventArgs e)
{
 this.Text = &amp;quot;Thanks for clicking&amp;quot;;
 this.BackColor = Color.Green;
 this.WindowState = FormWindowState.Maximized;
}
&lt;/pre&gt;
&lt;div class=&quot;divh1&quot;&gt;Program Demo for Windows Form Properties &lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigpRmWk-0ZGZfCagH5twLGN1nqeK1_wr9ysTCTcbeu1Lsn02jGWtKWk8V_s-J5PMmgstK_V7GidlLQ_67MUZIs-w14YQ2oY4eu4KD_RzGz7icE4uhiVIWVFy54TzxF8twjt9rpYMC_T7w/s1600/window+form+events.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigpRmWk-0ZGZfCagH5twLGN1nqeK1_wr9ysTCTcbeu1Lsn02jGWtKWk8V_s-J5PMmgstK_V7GidlLQ_67MUZIs-w14YQ2oY4eu4KD_RzGz7icE4uhiVIWVFy54TzxF8twjt9rpYMC_T7w/s1600/window+form+events.jpg&quot; height=&quot;158&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt; 
private void btnRed_Clickundefinedobject sender, EventArgs e)
 {
 this.BackColor = Color.Red;
 }
 private void btnGreen_Clickundefinedobject sender, EventArgs e)
 {
 this.BackColor = Color.Green;
 }
 private void btnBlue_Clickundefinedobject sender, EventArgs e)
 {
  this.BackColor = Color.Blue;
 }
&lt;/pre&gt;
&lt;div class=&quot;divh1&quot;&gt;Program Demo for Windows Form Properties &lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibRkYcrYEdkBw02fpjcwavV_kpbS6xgbVUc86cZqvLe8rFJ9d9x_AiT7xXantpC2WpdY0GUig06A8D-k0u9K2-T5l10YC6vcVSg7vwtXiu9mnCkkFnZsYfszecyp60UlcG88WSIRSc8uk/s1600/window+form+event2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibRkYcrYEdkBw02fpjcwavV_kpbS6xgbVUc86cZqvLe8rFJ9d9x_AiT7xXantpC2WpdY0GUig06A8D-k0u9K2-T5l10YC6vcVSg7vwtXiu9mnCkkFnZsYfszecyp60UlcG88WSIRSc8uk/s1600/window+form+event2.jpg&quot; height=&quot;170&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
private void btnNormal_Clickundefinedobject sender, EventArgs e)
 {
 this.WindowState = FormWindowState.Normal;
 }
 private void btnMinimize_Clickundefinedobject sender, EventArgs e)
 {
 this.WindowState = FormWindowState.Minimized;
 }
 private void btnMaximize_Clickundefinedobject sender, EventArgs e)
 {
 this.WindowState = FormWindowState.Maximized;
 }
 private void btnExit_Clickundefinedobject sender, EventArgs e)
 {
 this.Closeundefined);
 }
&lt;/pre&gt;
&lt;div class=&quot;divh1&quot;&gt;Program Demo for Windows Form Properties &lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbf601tS4JL2Kn2dat_V_kEQ0mcU7uQANyhMio65Hb_ZEq-41ckQNCqlCHQyG876jeiNzfNtG4qJGLUT2N9DZKS0UWVj02LsOwIFq5AOUspEIoyLq8mw9LzDbqOtpSXs7f1U_LwhbdXoE/s1600/window+form+event3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbf601tS4JL2Kn2dat_V_kEQ0mcU7uQANyhMio65Hb_ZEq-41ckQNCqlCHQyG876jeiNzfNtG4qJGLUT2N9DZKS0UWVj02LsOwIFq5AOUspEIoyLq8mw9LzDbqOtpSXs7f1U_LwhbdXoE/s1600/window+form+event3.jpg&quot; height=&quot;170&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
private void btnShowBackgroundImage_Clickundefinedobject sender, EventArgs e)
 {
  this.BackgroundImage = Image.FromFileundefined&amp;quot;c:\\globe.jpg&amp;quot;);
  this.BackgroundImageLayout = ImageLayout.Zoom;
 }
 private void btnClearBackgroundImage_Clickundefinedobject sender, EventArgs e)
 {
  this.BackgroundImage = null;
 }
&lt;/pre&gt;

&lt;div align=&quot;center&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/04/working-with-multi-form.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigpRmWk-0ZGZfCagH5twLGN1nqeK1_wr9ysTCTcbeu1Lsn02jGWtKWk8V_s-J5PMmgstK_V7GidlLQ_67MUZIs-w14YQ2oY4eu4KD_RzGz7icE4uhiVIWVFy54TzxF8twjt9rpYMC_T7w/s72-c/window+form+events.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-4736119168742462233</guid><pubDate>Sat, 05 Apr 2014 07:28:00 +0000</pubDate><atom:updated>2015-03-28T11:31:55.291-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Event Handling</category><category domain="http://www.blogger.com/atom/ns#">program for Event Handling</category><title>Event Handling</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;divh1&quot;&gt;Event Handling&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;b&gt;Def: &lt;/b&gt;&amp;nbsp;The &amp;nbsp;event &amp;nbsp;handling &amp;nbsp;includes &amp;nbsp;with &amp;nbsp;executing &amp;nbsp;some &amp;nbsp;code, &amp;nbsp;whenever &amp;nbsp;the &amp;nbsp;user performs an action.
&lt;div&gt;
The necessary code is to be written in a special method. That method is called as &lt;b&gt;Event Handler&lt;/b&gt;.&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: small;&quot;&gt;Event Handler:&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;An &amp;nbsp;event &amp;nbsp;handler &amp;nbsp;is &amp;nbsp;a &amp;nbsp;method, &amp;nbsp;which &amp;nbsp;will &amp;nbsp;be &amp;nbsp;called &amp;nbsp;automatically, &amp;nbsp;whenever &amp;nbsp;the &amp;nbsp;user performs certain event at run time.&lt;/li&gt;
&lt;li&gt;The event handler should be defined in the form class.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:csharp&quot;&gt;
private void controlname_eventname(object sender, EventArgs e)
      {
         //some code
      }
&lt;/pre&gt;
&lt;div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;In the above syntax, there are two arguments:&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;sender:&lt;/span&gt;&lt;/b&gt; &amp;nbsp;Represents &amp;nbsp;the &amp;nbsp;control, &amp;nbsp;based &amp;nbsp;on &amp;nbsp;which &amp;nbsp;the &amp;nbsp;event &amp;nbsp;is &amp;nbsp;raised. &amp;nbsp;For example, &amp;nbsp;in &amp;nbsp;the &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;button1_click&quot;&lt;/span&gt;&lt;/b&gt;&amp;nbsp; event &amp;nbsp;handler, &amp;nbsp;the &amp;nbsp;sender &amp;nbsp;argument represents button1 control.&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;e:&lt;/b&gt;&lt;/span&gt; Contains some additional information about the event. For example, in the &lt;b&gt;MouseClick&lt;/b&gt;&amp;nbsp; event, &amp;nbsp;the &amp;nbsp;position &amp;nbsp;of the &amp;nbsp;mouse &amp;nbsp;will &amp;nbsp;be represented, &amp;nbsp;where &amp;nbsp;it is clicked.&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Event &amp;nbsp;through &amp;nbsp;you &amp;nbsp;know &amp;nbsp;the &amp;nbsp;syntax &amp;nbsp;of &amp;nbsp;event &amp;nbsp;handler &amp;nbsp;properly, &amp;nbsp;don‘t &amp;nbsp;try &amp;nbsp;to &amp;nbsp;type &amp;nbsp;it manually in the code. The event handler method should be generated through the proper way.&lt;/li&gt;
&lt;li&gt;In the previous examples, you have generated the event handlers by double clicking on the controls.&lt;/li&gt;
&lt;li&gt;But already you know that, for all the controls, there are multiple events. But when you double &amp;nbsp;click &amp;nbsp;the &amp;nbsp;control, &amp;nbsp;it &amp;nbsp;will &amp;nbsp;generate &amp;nbsp;the &amp;nbsp;event &amp;nbsp;handler &amp;nbsp;for &amp;nbsp;only &amp;nbsp;one &amp;nbsp;event. &amp;nbsp;That particular event can be called as Default event.&lt;/li&gt;
&lt;li&gt;For example, the default event for the button is Click event.&lt;/li&gt;
&lt;li&gt;If you want to implement the event handlers for other controls, you require to follow the steps given below.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt;Implementation of Event Handler: &lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWX3xpl6glWs7NZ_XRNkvI7A9bTQYokmxujxXOg_pCRcnq9mapfjMZ7pxR-5cgzTKT-xxLp9drH1YJsRrMhUnBEXXB-8XAvQpi3-4CY7z8byGM2TW6jItMzdeQhDTPvLy1mWbsRfejf-o/s1600/implementation+of+event+handling.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWX3xpl6glWs7NZ_XRNkvI7A9bTQYokmxujxXOg_pCRcnq9mapfjMZ7pxR-5cgzTKT-xxLp9drH1YJsRrMhUnBEXXB-8XAvQpi3-4CY7z8byGM2TW6jItMzdeQhDTPvLy1mWbsRfejf-o/s1600/implementation+of+event+handling.jpg&quot; height=&quot;200&quot; width=&quot;82&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;First, in the design window, select the form or control, for which you want to create the event handler.&lt;/li&gt;
&lt;li&gt;Open Properties &amp;nbsp;window, &amp;nbsp;and &amp;nbsp;click &amp;nbsp;on &amp;nbsp;Events option.&lt;/li&gt;
&lt;li&gt;Select &amp;nbsp;the &amp;nbsp;required &amp;nbsp;event, &amp;nbsp;for &amp;nbsp;which &amp;nbsp;you &amp;nbsp;want &amp;nbsp;to &amp;nbsp;create the event handler.&lt;/li&gt;
&lt;li&gt;Press Enter.&lt;/li&gt;
&lt;li&gt;Then &amp;nbsp;the &amp;nbsp;event &amp;nbsp;handler &amp;nbsp;will &amp;nbsp;be &amp;nbsp;created &amp;nbsp;in &amp;nbsp;the &amp;nbsp;code window.&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;
&lt;/div&gt;
&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;Demo on Event Handling &lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr640DyllI-bLvNSW_02l8dMIv_-HVUHl_PJb8v-USJ3CqIPdiKLp7bfueGxQCcjXAyIF2GKdLzscZwlWXvxJfQRDDPlPniw8YsbcxsIWRDykkD7xH1ot-Fe6yUkd9h2mKEJ5jq1vYAUY/s1600/Click+Me.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr640DyllI-bLvNSW_02l8dMIv_-HVUHl_PJb8v-USJ3CqIPdiKLp7bfueGxQCcjXAyIF2GKdLzscZwlWXvxJfQRDDPlPniw8YsbcxsIWRDykkD7xH1ot-Fe6yUkd9h2mKEJ5jq1vYAUY/s1600/Click+Me.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
private void button1_Clickundefinedobject sender, EventArgs e)
 {
  MessageBox.Showundefined&amp;quot;You have clicked the button&amp;quot;);
 }
private void button1_MouseEnterundefinedobject sender, EventArgs e)
 {
  button1.BackColor = Color.Yellow;
  button1.ForeColor = Color.DarkRed;
 }
 private void button1_MouseLeaveundefinedobject sender, EventArgs e)
 {
  button1.BackColor = Color.DarkRed;
  button1.ForeColor = Color.Yellow;
 }
&lt;/pre&gt;
&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/04/event-handling.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWX3xpl6glWs7NZ_XRNkvI7A9bTQYokmxujxXOg_pCRcnq9mapfjMZ7pxR-5cgzTKT-xxLp9drH1YJsRrMhUnBEXXB-8XAvQpi3-4CY7z8byGM2TW6jItMzdeQhDTPvLy1mWbsRfejf-o/s72-c/implementation+of+event+handling.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-6406521587933462013</guid><pubDate>Sat, 05 Apr 2014 07:11:00 +0000</pubDate><atom:updated>2015-03-15T12:12:36.618-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">assign property value at runtime</category><title>Change Property Value at Run Tiime</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;divh1&quot;&gt;Change Property Value at Run Time&lt;/div&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;

&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;You can change the property values at run time (programmatically).&lt;/li&gt;
&lt;li&gt;For &amp;nbsp;example, &amp;nbsp;you &amp;nbsp;have &amp;nbsp;designed &amp;nbsp;a &amp;nbsp;button &amp;nbsp;with &amp;nbsp;blue &amp;nbsp;background. &amp;nbsp;Later, &amp;nbsp;after &amp;nbsp;the &amp;nbsp;user clicks it, you want to display that button with green background.&lt;/li&gt;
&lt;li&gt;Then you require to change the &lt;b&gt;BackColor&lt;/b&gt;&amp;nbsp;property value at run time.&lt;/li&gt;
&lt;li&gt;Syntax:&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: red;&quot;&gt;controlname.property = value;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Ex:&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: red;&quot;&gt;button1.Text = &lt;b&gt;Button is clicked&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;But &amp;nbsp;sometimes, &amp;nbsp;when &amp;nbsp;you &amp;nbsp;are &amp;nbsp;trying &amp;nbsp;to &amp;nbsp;change &amp;nbsp;some &amp;nbsp;property &amp;nbsp;values, &amp;nbsp;you &amp;nbsp;may &amp;nbsp;face some problems.&lt;/li&gt;
&lt;li&gt;For example, the following statements are not valid statements:&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button1.BackColor = green;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button1.Cursor = hand;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button1.TextAlign = TopLeft;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;So, while you are changing the property values, you remember and follow the following syntaxes:&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;Assign Property Values at Run Time&lt;/div&gt;
&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;

 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Property&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt; STATEMENT TO ASSIGN THE VALUE AT RUN TIME&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Name&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Not possible to change at run time&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Text&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;controlname.Text = &quot;xxxxx&quot;;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enabled&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;controlname.Enabled = true / false;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Visible&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;controlname.Visible = true / false;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Location&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;controlname.Location = new System.Drawing.Point(x, y);&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Size&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;controlname.Size = new System.Drawing.Size(width, height);&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Font&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;controlname.Font  =  new  System.Drawing.Font(&quot;font  name&quot;, fontsize);&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;BackColor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt; controlname.BackColor = System.Drawing.Color.xxxxx;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ForeColor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;controlname.ForeColor = System.Drawing.Color.xxxxx;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Cursor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;controlname.Cursor = System.Windows.Forms.Cursors.xxxxx;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Image&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;controlname.Image  =  System.Drawing.Image.FromFile(&quot;image  file path&quot;);&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;TextAlign&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;controlname.TextAlign = System.Drawing.ContentAlignment.MiddleRight;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ImageAlign&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;controlname.TextAlign = System.Drawing.ContentAlignment.MiddleRight;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;TabIndex&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;controlname.TabIndex = n;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ContextMenuStrip&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt; controlname.ContextMenuStrip = xxxxx;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class=&quot;divh1&quot;&gt;Demo on Changing Property Values at Run Time&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUuAUhr2ZLH19nurX2nRXzmnw93H5eWxkiszoA_pDlWWQHxnis_kor8w0cpQ8wFS_UGpBEJzgscq75h_H6dqSZ3JZH3t9mmT_INXkL90lcdilCqY5c8AnhN9JQ6TXOK1UpWeWXrgqbr2U/s1600/Change+Property+value+at+run+time.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUuAUhr2ZLH19nurX2nRXzmnw93H5eWxkiszoA_pDlWWQHxnis_kor8w0cpQ8wFS_UGpBEJzgscq75h_H6dqSZ3JZH3t9mmT_INXkL90lcdilCqY5c8AnhN9JQ6TXOK1UpWeWXrgqbr2U/s1600/Change+Property+value+at+run+time.jpg&quot; height=&quot;188&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:csharp&quot;&gt;
private void button2_Click(object sender, EventArgs e)
 {
  button1.Text = &quot;My Test Button&quot;;
 }
 private void button3_Click(object sender, EventArgs e)
 {
  button1.Enabled = false;
 }
 private void button4_Click(object sender, EventArgs e)
 {
  button1.Enabled = true;
 }
 private void button5_Click(object sender, EventArgs e)
 {
  button1.Visible = false;
 }
 private void button6_Click(object sender, EventArgs e)
 {
  button1.Visible = true;
 }
 private void button7_Click(object sender, EventArgs e)
 {
  button1.Location = new Point(150, 400);
 }
 private void button8_Click(object sender, EventArgs e)
 {
  button1.Size = new Size(250, 100);
 }
 private void button9_Click(object sender, EventArgs e)
 {
  button1.Font = new Font(&quot;Showcard Gothic&quot;, 17);
 }
 private void button10_Click(object sender, EventArgs e)
 {
  button1.BackColor = Color.LightCoral;
 }
 private void button11_Click(object sender, EventArgs e)
 {
  button1.ForeColor = Color.Green;
 }
 private void button12_Click(object sender, EventArgs e)
 {
  button1.Image = Image.FromFile(&quot;c:\\flagindia.gif&quot;);
  button1.ImageAlign = ContentAlignment.MiddleLeft;
  button1.TextAlign = ContentAlignment.MiddleRight;
  button1.Size = new Size(200, 60);
 } 
&lt;/pre&gt;
&lt;div align=&quot;center&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/04/change-property-value-at-run-tiime.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUuAUhr2ZLH19nurX2nRXzmnw93H5eWxkiszoA_pDlWWQHxnis_kor8w0cpQ8wFS_UGpBEJzgscq75h_H6dqSZ3JZH3t9mmT_INXkL90lcdilCqY5c8AnhN9JQ6TXOK1UpWeWXrgqbr2U/s72-c/Change+Property+value+at+run+time.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-1915499456879398584</guid><pubDate>Sat, 05 Apr 2014 06:59:00 +0000</pubDate><atom:updated>2015-03-15T12:36:23.571-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Control Handling Windows Form</category><category domain="http://www.blogger.com/atom/ns#">Demo on Buttons</category><category domain="http://www.blogger.com/atom/ns#">Property of Window Controls</category><title>Control Handling Windows Form</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;b&gt;Next :&lt;/b&gt; &lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/04/change-property-value-at-run-tiime.html&quot;&gt;Change Property value at Run Time&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;Control Handling Windows Form&lt;/div&gt;&lt;br/&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt;Common Properties for all the controls:&lt;/div&gt;
&lt;b&gt;The following properties commonly available for all the controls:&lt;/b&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;Common Properties&lt;/div&gt;

&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;

 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Property&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Name&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt; Specifies the name of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Text&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt; Specifies the displayable text of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;BackColor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt; Specifies the background color of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ForeColor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the foreground color of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Font&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the font style of the control‘s text.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enabled&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enables / Disables the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Visible&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt; Displays / Hides the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Cursor&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the mouse pointer style, when the mouse is over on the control at run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Runtime&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Size&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the Width and Height of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Location&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the X and Y co-ordinations of the control‘s position on the form.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;TextAlign&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt; Specifies the position of the text in the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Image&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies  the  image  that  is  to  be  displayed  in  the  control  along  with  the text.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ImageAlign&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the position of the image in the control&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;TabIndex&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Specifies the index of the control in the tab order.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;ContentMenuStrip&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Contains the reference of the respective context menu control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;br/&gt;

&lt;div class=&quot;divh1&quot;&gt;COMMON EVENTS FOR ALL THE CONTROLS:&lt;/div&gt;
&lt;p&gt;The following events commonly available for all the controls:&lt;/p&gt;

&lt;div class=&quot;divh1&quot;&gt;COMMON EVENTS&lt;/div&gt;&lt;br/&gt;


&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;

 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Event&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Click&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the user clicks the control run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;DoubleClick&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the user double-clicks the control at run time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MouseMove&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the mouse pointer is moves across the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MouseEnter&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the mouse pointer is focused on to the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;MouseLeave&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the mouse pointer is out of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;KeyPress&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when any key is pressed on the keyboard, while  the  focus  is  on the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Enter&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the focus is entered into the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;Leave&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Executes when the focus got out of the control.&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;b&gt;Event:&lt;/b&gt; An event is a run time action that can be performed by the user.&lt;br/&gt;

Let us practice the above properties and events on the button control.&lt;/p&gt;
&lt;div class=&quot;divh1&quot;&gt;Demo on Buttons &lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Take a new Windows Forms Application project.&lt;/li&gt;
&lt;li&gt;Design the form as follows:&lt;/li&gt;
&lt;li&gt;To design the form as above set the following properties&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbyqJaK-NUEKr6Zft_1U1sDdh1sYNJVJWVqut-bUHw-VCFXuX5VJBiMTzzRhxIt72rH2dY7RZOL0I2i63I6cjl37uA_kRcg4TrLj4UP5gwvq_lPbil0RTbQ21tphqygCjAM3HpNscQ5eo/s1600/demo+on+buttons.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Windows Form Controls&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbyqJaK-NUEKr6Zft_1U1sDdh1sYNJVJWVqut-bUHw-VCFXuX5VJBiMTzzRhxIt72rH2dY7RZOL0I2i63I6cjl37uA_kRcg4TrLj4UP5gwvq_lPbil0RTbQ21tphqygCjAM3HpNscQ5eo/s1600/demo+on+buttons.jpg&quot; height=&quot;155&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4SPDyNTukDRFFBUv4Q6PDX4gu6ff1aEG_oX4imlgPFx84hVk-zsUVGt8N98CCOAftjvSoqagI4SpND8ltd380z8KUV93FapaQgYP7Puk08M_48N3L6A_8avb0B-DIzlJ72CCmwppYddQ/s1600/property+of+button.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Properties of Controls&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4SPDyNTukDRFFBUv4Q6PDX4gu6ff1aEG_oX4imlgPFx84hVk-zsUVGt8N98CCOAftjvSoqagI4SpND8ltd380z8KUV93FapaQgYP7Puk08M_48N3L6A_8avb0B-DIzlJ72CCmwppYddQ/s1600/property+of+button.jpg&quot; height=&quot;200&quot; width=&quot;194&quot; /&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;Double click on Button1 and Write the following code:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
private void button1_Click(object sender, EventArgs e)
{
      DateTime dt = DateTime.Now;
      MessageBox.Show(dt.ToString());
}
&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Double click on Button2 and Write the following code:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
private void button2_Click(object sender, EventArgs e)
{
   Random r = new Random();
   int n = r.Next(1, 500);
   MessageBox.Show(n.ToString());
}
&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Double click on Button3 and Write the following code:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
private void button3_Click(object sender, EventArgs e)
{
   MessageBox.Show(&quot;Bye....&quot;);
  Application.Exit();
} 
&lt;/pre&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;b&gt;Next :&lt;/b&gt; &lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/04/change-property-value-at-run-tiime.html&quot;&gt;Change Property value at Run Time&lt;/a&gt;
&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/04/control-handling-windows-form.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbyqJaK-NUEKr6Zft_1U1sDdh1sYNJVJWVqut-bUHw-VCFXuX5VJBiMTzzRhxIt72rH2dY7RZOL0I2i63I6cjl37uA_kRcg4TrLj4UP5gwvq_lPbil0RTbQ21tphqygCjAM3HpNscQ5eo/s72-c/demo+on+buttons.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-5304339634806588827</guid><pubDate>Wed, 02 Apr 2014 15:20:00 +0000</pubDate><atom:updated>2015-06-24T02:01:13.649-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Linq</category><category domain="http://www.blogger.com/atom/ns#">LINQ with Lambda Expressions</category><title>LINQ With Lambda Expressions</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;divh1&quot;&gt;LINQ With Lambda Expressions&lt;/div&gt;&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;LINQ queries can be written in two syntaxes:
&lt;ol&gt;
&lt;li&gt; &amp;nbsp;General Query Syntax&lt;/li&gt;
&lt;li&gt; &amp;nbsp;Lambda Expression Syntax&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;li&gt;The previously written applications are written with General Query Syntax.&lt;/li&gt;
&lt;li&gt;Syntax for Lambda Expression:&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;color: red;&quot;&gt;DataSource.Clause(DataAliasName =&amp;gt; Expression)&lt;/span&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Ex: &amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;stu.Where(s =&amp;gt; s.Marks &amp;lt; 300)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt;Program with LINQ to LAMBDA EXPRESSIONS&lt;/div&gt;
&lt;pre class=&quot;brush:csharp&quot;&gt;
Student.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LINQtoObjectsDemo
{
   class Student
    {
      //fields
        public int StudentID;
        public string Name;
        public string Course;
        public int Marks;
     //constructor
        public Student(int StudentID, string Name, string Course, int Marks)
         {
            this.StudentID = StudentID;
            this.Name = Name;
            this.Course = Course;
            this.Marks = Marks;
        }
    }
}

Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LINQwithLambaExpressions
{
  class Program
   {
     static void Main(string[] args)
      {
        //data source
          Student[] stu = { new Student(101, &quot;Prakash&quot;, &quot;MBA&quot;, 765),
                                    new Student(102, &quot;Pradeep&quot;, &quot;MBA&quot;, 471),
                                    new Student(103, &quot;Pushpa&quot;, &quot;Msc&quot;, 590),
                                    new Student(104, &quot;Purna&quot;, &quot;MCA&quot;, 223),
                                     new Student(105, &quot;Purnima&quot;, &quot;MCA&quot;, 450)};
       //linq query with where clause
         IEnumerable&lt;Student&gt; result1 = stu.Where(s =&gt; s.Course == &quot;MCA&quot;);
         Console.WriteLine(&quot;MCA Students:&quot;);
         foreach (Student r in result1)
         Console.WriteLine(r.StudentID + &quot;, &quot; + r.Name + &quot;, &quot; + r.Course + &quot;, &quot; + r.Marks);
       //linq query with compound where clause
         IEnumerable&lt;Student&gt; result2 = stu.Where(s =&gt; s.Name.EndsWith(&quot;a&quot;) &amp;&amp; s.Marks &gt;= 400 &amp;&amp;                                                                 s.Marks &lt;= 600);
         Console.WriteLine(&quot;\nStudents whose name ends with &#39;a&#39;, and marks is &gt;=400 and &lt;=600:&quot;);
         foreach (Student r in result2)
         Console.WriteLine(r.StudentID + &quot;, &quot; + r.Name + &quot;, &quot; + r.Course + &quot;, &quot; + r.Marks);
       //linq query with orderby clause
         IEnumerable&lt;Student&gt; result4 = stu.OrderBy(s =&gt; s.Marks);
         Console.WriteLine(&quot;\nStudents (sort on marks):&quot;);
         foreach (Student r in result4)
         Console.WriteLine(r.StudentID + &quot;, &quot; + r.Name + &quot;, &quot; + r.Course + &quot;, &quot; + r.Marks);
       //linq query with orderby clause (descending)
         IEnumerable&lt;Student&gt; result5 = stu.OrderByDescending(s =&gt; s.Marks);
         Console.WriteLine(&quot;\nStudents (sort on marks - descending):&quot;);
         foreach (Student r in result5)
         Console.WriteLine(r.StudentID + &quot;, &quot; + r.Name + &quot;, &quot; + r.Course + &quot;, &quot; + r.Marks);
       //linq query with group clause
         IEnumerable&lt;IGrouping&lt;string, Student&gt;&gt; result6 = stu.GroupBy(s =&gt; s.Course);
          Console.WriteLine(&quot;\nStudents with grouping:&quot;);
          foreach (IGrouping&lt;string, Student&gt;&gt; StuGrp in  result6)
           {
             Console.WriteLine(StuGrp.Key + &quot;:&quot;);
              foreach (Student r in StuGrp)
             Console.WriteLine(&quot; &quot; + r.StudentID + &quot;, &quot; + r.Name + &quot;, &quot; + r.Course + &quot;, &quot; + r.Marks);
            }
            Console.Read();
        }
    }
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;b&gt;Previous Page :&amp;nbsp;&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/linq_24.html&quot;&gt;LINQ&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;


&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/linq-with-lambda-expressions.html</link><author>noreply@blogger.com (fdfsdf)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-3868565855838171344</guid><pubDate>Mon, 31 Mar 2014 16:05:00 +0000</pubDate><atom:updated>2015-03-15T13:11:02.215-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Development of Form</category><category domain="http://www.blogger.com/atom/ns#">Progress</category><title>Development of Form</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;divh1&quot;&gt;Development of Form&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;br/&gt;



&lt;b&gt;It includes with two stages:&lt;/b&gt;
&lt;ol&gt;
&lt;li&gt;Designing&lt;/li&gt;
&lt;li&gt;Coding&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt; 1) Designing the Form:&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Drag and Drop the controls from the ToolBox.&lt;/li&gt;
&lt;li&gt;A Sample Windows Application Project (with Login Form)&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA7gdB-KUVnlKY-7Oyj1U46mJJmGUyQKkhBLkr8rlzCtA2RiWXVuXprr8y8Jhf86-cKpy0bbTW5RXz34xdWLyXaXqy31OR_5XrXD404p2Yx4ulZAZaSKnRyyE4heVg4yGr_8RWlAlYHOc/s1600/Window+Login+Form.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Window Login Form&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA7gdB-KUVnlKY-7Oyj1U46mJJmGUyQKkhBLkr8rlzCtA2RiWXVuXprr8y8Jhf86-cKpy0bbTW5RXz34xdWLyXaXqy31OR_5XrXD404p2Yx4ulZAZaSKnRyyE4heVg4yGr_8RWlAlYHOc/s1600/Window+Login+Form.jpg&quot; height=&quot;231&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmXBiGMrwUHzFL70UP5l0W7qJ0aQann1PLEsFT2ue1XcxfhSVWhgw-101IN_M26wWIvBuy9RKo-ea5TSQckyaL9LIhnERHF2M6YS3anynov5M_G1r4Efe_xkJPErF5O-nt5xzm4h-YD24/s1600/window+form+designing.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Window Form Designing&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmXBiGMrwUHzFL70UP5l0W7qJ0aQann1PLEsFT2ue1XcxfhSVWhgw-101IN_M26wWIvBuy9RKo-ea5TSQckyaL9LIhnERHF2M6YS3anynov5M_G1r4Efe_xkJPErF5O-nt5xzm4h-YD24/s1600/window+form+designing.jpg&quot; height=&quot;231&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Select the control and set the properties as your wish.&lt;/li&gt;
&lt;li&gt;For example, set the following properties as per given below:&lt;/li&gt;
&lt;ol&gt;&lt;li&gt;Form1&lt;/li&gt; &lt;ul&gt;&lt;li&gt;Text: Login&lt;/li&gt;&lt;/ul&gt; 
    &lt;li&gt;Label1&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Text: User Name&lt;/li&gt;&lt;/ul&gt;
    &lt;li&gt;Label2&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Text: Password&lt;/li&gt;&lt;/ul&gt;
    &lt;li&gt;TextBox1&lt;/li&gt;&lt;ul&gt;&lt;li&gt;(No properties are required in this example)&lt;/li&gt;&lt;/ul&gt;
    &lt;li&gt;TextBox2&lt;/li&gt;&lt;ul&gt;&lt;li&gt;PasswordChar: *&lt;/li&gt;&lt;/ul&gt;
    &lt;li&gt;Button1&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Text: OK&lt;/li&gt;&lt;/ul&gt;
    &lt;li&gt;Button2&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Text: Cancel&lt;/li&gt;&lt;/ul&gt;
&lt;/ol&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; 2) Coding the Form:&lt;/span&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Double click on the controls and write the code in the Code window.&lt;/li&gt;
&lt;li&gt;For example, double click on OK button and write the following code:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
private void button1_Click(object sender, EventArgs e)
{
   if (textBox1.Text == &quot;system&quot; &amp;&amp; textBox2.Text == &quot;manager&quot;)
   MessageBox.Show(&quot;Login is successful.&quot;);
   else
   MessageBox.Show(&quot;Invalid Login.&quot;);
}
&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;And then, double click on ―Cancel‖ button and write the following code:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
private void button2_Click(object sender, EventArgs e)
{
  Application.Exit();
}
&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;The above process is called as Form coding.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt;Every Form is a Class:&lt;/span&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;C#.NET recognizes every form as a class.&lt;/li&gt;
&lt;li&gt;In VB 6.0, every form is known as an object for the Form class. But in C#, every form is  a  class;  so  that  at  run  time,  you  can  create  a ny  no.  of  objects  as  your  wish.  For example,  if  you  want  to  display  Login  form  twice  at  run  time,  you  can  simply  create two objects and can show it.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt;The Automatic Generated Code:&lt;/span&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;While  you  design  the  controls,  the  Visual  Studio  generates  some  automatic  code  in  the “Form1.Designer.cs” file.&lt;/li&gt;
&lt;li&gt;To  open  this  file,  Open  Solution  Explorer,  Expand  Form1,  then  double  click  on Form1.Designer.cs.&lt;/li&gt;
&lt;li&gt;For  example,  you  can  see  the  automatic  generated  code  for  the  previous  Login example&lt;/li&gt;
&lt;/ol&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;Default.aspx.cs:&lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
namespace WindowsFormsApplication1
{
partial class Form1
{
/// &lt;summary&gt;
/// Required designer variable.
/// &lt;/summary&gt;
private System.ComponentModel.IContainer components = null;
/// &lt;summary&gt;
/// Clean up any resources being used.
/// &lt;/summary&gt;
/// &lt;param name=&quot;disposing&quot;&gt;true if managed resources should be disposed; 
otherwise, false.&lt;/param&gt;
protected override void Dispose(bool disposing)
{
if (disposing &amp;&amp; (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// &lt;summary&gt;
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// &lt;/summary&gt;
private void InitializeComponent()
{
 this.textBox1 = new System.Windows.Forms.TextBox();
 this.textBox2 = new System.Windows.Forms.TextBox();
 this.button1 = new System.Windows.Forms.Button();
 this.button2 = new System.Windows.Forms.Button();
 this.label1 = new System.Windows.Forms.Label();
 this.label2 = new System.Windows.Forms.Label();
 this.SuspendLayout();
// 
// textBox1
// 
 this.textBox1.Location = new System.Drawing.Point(186, 44);
 this.textBox1.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
 this.textBox1.Name = &quot;textBox1&quot;;
 this.textBox1.Size = new System.Drawing.Size(232, 27);
 this.textBox1.TabIndex = 0;
// 
// textBox2
// 
 this.textBox2.Location = new System.Drawing.Point(186, 102);
 this.textBox2.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
 this.textBox2.Name = &quot;textBox2&quot;;
 this.textBox2.PasswordChar = &#39;*&#39;;
 this.textBox2.Size = new System.Drawing.Size(232, 27);
 this.textBox2.TabIndex = 1;
// 
// button1
// 
 this.button1.Location = new System.Drawing.Point(186, 167);
 this.button1.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
 this.button1.Name = &quot;button1&quot;;
 this.button1.Size = new System.Drawing.Size(107, 37);
 this.button1.TabIndex = 2;
 this.button1.Text = &quot;OK&quot;;
 this.button1.UseVisualStyleBackColor = true;
 this.button1.Click += new System.EventHandler(this.button1_Click); 

// 
// button2
// 
 this.button2.Location = new System.Drawing.Point(314, 167);
 this.button2.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
 this.button2.Name = &quot;button2&quot;;
 this.button2.Size = new System.Drawing.Size(107, 37);
 this.button2.TabIndex = 3;
 this.button2.Text = &quot;Cancel&quot;;
 this.button2.UseVisualStyleBackColor = true;
 this.button2.Click += new System.EventHandler(this.button2_Click);
// 
// label1
// 
 this.label1.AutoSize = true;
 this.label1.Location = new System.Drawing.Point(64, 48);
 this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
 this.label1.Name = &quot;label1&quot;;
 this.label1.Size = new System.Drawing.Size(104, 19);
 this.label1.TabIndex = 4;
 this.label1.Text = &quot;User Name:&quot;;
// 
// label2
// 
 this.label2.AutoSize = true;
 this.label2.Location = new System.Drawing.Point(64, 107);
 this.label2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
 this.label2.Name = &quot;label2&quot;;
 this.label2.Size = new System.Drawing.Size(93, 19);
 this.label2.TabIndex = 5;
 this.label2.Text = &quot;Password:&quot;;
// 
// Form1
// 
 this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 19F);
 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
 this.ClientSize = new System.Drawing.Size(492, 244);
 this.Controls.Add(this.label2);
 this.Controls.Add(this.label1);
 this.Controls.Add(this.button2);
 this.Controls.Add(this.button1);
 this.Controls.Add(this.textBox2);
 this.Controls.Add(this.textBox1);
 this.Font = new System.Drawing.Font(&quot;Tahoma&quot;, 12F, 
 System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
 this.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
 this.Name = &quot;Form1&quot;;
 this.Text = &quot;Login&quot;;
 this.ResumeLayout(false);
 this.PerformLayout(); 

}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
}
}
&lt;/pre&gt;

&lt;ol&gt;
&lt;li&gt;Don‘t  worry  about  the  above  automatic  generated  code;  it  will  be  generated  automatically, while you design the form in the Design window.&lt;/li&gt;
&lt;li&gt;The entire code is generated in a method called InitializeComponent().&lt;/li&gt;
&lt;li&gt;Finally, coming to a conclusion; every form contains two files:&lt;/li&gt;
&lt;li&gt;Form1.Designer.cs&lt;/li&gt;
&lt;li&gt;Contains the code for designing (Automatically generated code by Visual Studio).&lt;/li&gt;
&lt;li&gt;Form1.cs&lt;/li&gt;
&lt;li&gt;Contains the actual functionality code (Written by the Programmer).&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;divh1&quot;&gt;Class Definition Syntax of a Windows Form&lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
//Form1.cs

importing section;
namespace ProjectName
{
 public partial class FormName : Form
  {
   public FormName()
   {
    InitializeComponent();
   }
  }
}
&lt;/pre&gt;
&lt;div class=&quot;divh1&quot;&gt;Rules for the Form class definition:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;In the importing section, you can import the necessary namespaces that you want.&lt;/li&gt;
&lt;li&gt;The namespace name should be same as project name.&lt;/li&gt;
&lt;li&gt;A user-defined class with the form name is to be defined.&lt;/li&gt;
&lt;li&gt;It should be the sub class of &quot;System.Windows.Forms.Form&quot; class; as it offers some visual design, properties, methods and events for the user-defined form class.&lt;/li&gt;
&lt;li&gt;It  will  be  defined  as  a  public  class  (this  is  optional).  Whenever  it  is  a  public  class,  in future, it can be accessed from other projects also.
It should be defined as &quot;partial&quot; class, as its definition is written in the following two files.
                --&gt;  Form1.cs
                --&gt;  Form1.Designer.cs&lt;/li&gt;
&lt;li&gt;It  should  contain  a  constructor,  with  a  statement  called  InitializeComponent();, which calls the designer code that is generated in Form1.Designer.cs file.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt; “Program.cs” file in Windows Forms Applications:&lt;/div&gt;
&lt;ol&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFRrgO5npODsraC6rVnJIHkAB_Ayrj5d4e_kf_xk0Bd-46t_F8GzNpYUmTlyfAvYn4Rq5W6BABDsIjh5Jtkka_Vc1evRX0zgNiZE-siHsc15dH9Vla_ygL_OlbZFX4QXvZHppmgA5KICc/s1600/Progress.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFRrgO5npODsraC6rVnJIHkAB_Ayrj5d4e_kf_xk0Bd-46t_F8GzNpYUmTlyfAvYn4Rq5W6BABDsIjh5Jtkka_Vc1evRX0zgNiZE-siHsc15dH9Vla_ygL_OlbZFX4QXvZHppmgA5KICc/s1600/Progress.jpg&quot; height=&quot;231&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;li&gt;Generally,  when  you  Start  the  windows  application project,  automatically  the  Form1 will be appeared on the screen.&lt;/li&gt;
&lt;li&gt;Then don‘t think like directly Form1 will be opened.&lt;/li&gt;
&lt;li&gt;In fact, when you click on Start option, the Main() method will be invoked first.&lt;/li&gt;
&lt;li&gt;Like Console Applications, Main() method is located in Program.cs file&lt;/li&gt;
&lt;li&gt;For reference you open Solution Explorer &amp;nbsp;―&amp;gt; Program.cs file.&lt;/li&gt;
&lt;li&gt;In the Main() method, you can see two important statements.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt;Application.EnableVisualStyles();&lt;/div&gt;
&lt;p&gt;
This  statement  enables  the  better  styles  (for  sleek  appearance)  for  the entire  application,  based  on  the  current  working  theme  offered  by  the O/S.
&lt;/p&gt;
&lt;div class=&quot;divh1&quot;&gt;Application.Run(new Form1());&lt;/div&gt;
&lt;p&gt;
This statement creates a new Form1 class object and that object will be shown on the screen.&lt;/p&gt;
&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/development-of-form.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA7gdB-KUVnlKY-7Oyj1U46mJJmGUyQKkhBLkr8rlzCtA2RiWXVuXprr8y8Jhf86-cKpy0bbTW5RXz34xdWLyXaXqy31OR_5XrXD404p2Yx4ulZAZaSKnRyyE4heVg4yGr_8RWlAlYHOc/s72-c/Window+Login+Form.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-442480395672511933</guid><pubDate>Mon, 31 Mar 2014 15:59:00 +0000</pubDate><atom:updated>2015-03-15T13:29:19.144-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Character User Interface</category><category domain="http://www.blogger.com/atom/ns#">Graphical User Interface</category><title>Windows Forms Applications</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;float:right;&quot;&gt;&lt;b&gt;Next : &lt;/b&gt;&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/development-of-form.html&quot;&gt;Development of Form&lt;/a&gt;&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;Windows Forms Applications&lt;/div&gt;&lt;br/&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;C# supports two kinds of User Interfaces.&lt;/p&gt;
&lt;div class=&quot;divh1&quot;&gt; C.U.I (Character User Interface)&lt;/div&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0SCY3lvFmM-8Rb5HuQ9z6sI1cgVQSHluLE2wAkO9-t7Zd_IsAcYwz7tvWlewtViXp6NBM_ayzYmTlyx1ycBDNI4eK3-hLkno6euJKuNvvDhfOzY3JHsYtu2ISTzBQxH8zXctnbWNU68Q/s1600/cui.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Character User Interface&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0SCY3lvFmM-8Rb5HuQ9z6sI1cgVQSHluLE2wAkO9-t7Zd_IsAcYwz7tvWlewtViXp6NBM_ayzYmTlyx1ycBDNI4eK3-hLkno6euJKuNvvDhfOzY3JHsYtu2ISTzBQxH8zXctnbWNU68Q/s1600/cui.jpg&quot; height=&quot;120&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;This  user  interface  supports  a  blank  screen,  with  some  characters only.&lt;/li&gt;
&lt;li&gt;It  is  not  attractive  for  the  user.  That‘s  why it  is  not suitable  for the live projects.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt; G.U.I (Graphical User Interface)&lt;/div&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQyYA2N8s2sGm4lSQkUQB8wPmpvlhbBsoOOD69Z9YJIulTCQL0ogf7su-ybmaoZghauiCi2zFsBbBCwcMxCNCHaWTDLG8RGwUyU0Sseqf8382HaQGoJsh-uLqFoN1yFXZkhg518-nqsyw/s1600/GUI.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Graphical User Interface&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQyYA2N8s2sGm4lSQkUQB8wPmpvlhbBsoOOD69Z9YJIulTCQL0ogf7su-ybmaoZghauiCi2zFsBbBCwcMxCNCHaWTDLG8RGwUyU0Sseqf8382HaQGoJsh-uLqFoN1yFXZkhg518-nqsyw/s1600/GUI.jpg&quot; height=&quot;120&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;It  supports  graphical  components  like  windows,  icons,  mouse pointer, toolbars, status bars, buttons etc.&lt;/li&gt;
&lt;li&gt;It  is  attractive  for  the  user.  That‘s  why  it  is  suitable  for  the  live projects. &lt;/li&gt;
&lt;li&gt;Almost all the software‘s you are using today like Notepad, WordPad, Paint,  MS  Word,  My  computer  and  My  documents  etc.,  are  the  GUI applications.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt;Windows Forms Application:&lt;/div&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAi7Uz-E0hohBsZkxdLRZLpv1kaVwiNP-Mu4SqTcoOY8GDbVF-V9HEyhUaY1dTKn4XGTd9GZ9Sna6lz3W-vqg0FWLntVmE_4XNbHw9y-924WTUHYzN7h6tLdTIKSNnPyeAZ38et-12yPU/s1600/wfa.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Window Application&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAi7Uz-E0hohBsZkxdLRZLpv1kaVwiNP-Mu4SqTcoOY8GDbVF-V9HEyhUaY1dTKn4XGTd9GZ9Sna6lz3W-vqg0FWLntVmE_4XNbHw9y-924WTUHYzN7h6tLdTIKSNnPyeAZ38et-12yPU/s1600/wfa.jpg&quot; height=&quot;90&quot; width=&quot;150&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;It can also be called as Windows Application.&lt;/li&gt;
&lt;li&gt;It‘s a collection of windows forms.&lt;/li&gt;
&lt;/ol&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;Form:&lt;/div&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPtoFbcP4IMfrGDU-9qJDN9w2kXbEMAMSTkIBCW4EGoqsLfAAtho2sBCJkuLDpoe0YGXzK8pBpuzYWJh2KwKjBJwDLzgpVhUK4i3sU_jmN8t-Of5jD3a_ixACYPBof793qQ3dSrqVaEFA/s1600/window+form.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img alt=&quot;Window Form Application&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPtoFbcP4IMfrGDU-9qJDN9w2kXbEMAMSTkIBCW4EGoqsLfAAtho2sBCJkuLDpoe0YGXzK8pBpuzYWJh2KwKjBJwDLzgpVhUK4i3sU_jmN8t-Of5jD3a_ixACYPBof793qQ3dSrqVaEFA/s1600/window+form.jpg&quot; width=&quot;200px&quot; height=&quot;120px&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;The  graphical  container,  which can  contain  the  graphical controls  like  labels,  textboxes, buttons, list boxes etc., is called as Form.  It  acts  as  container for the controls.&lt;/li&gt;
&lt;li&gt;It is also called as a window.&lt;/li&gt;
&lt;li&gt;It  has  the  visual  appearance with a title bar, icon, control box (with minimize button, maximize button and close button)&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt;Creating a “Windows Forms Application” project:&lt;/div&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiACX8SXFjpL59bBtqjtB74BTRs2Pwpw-MQAbsyXcylEWrBAprAL0x1qM2BPl8sJeUB6qyFDRNg9o6gc6ukZSmBeH5MXmTMsTZLYXQhGGmJjUj7dlmAI6qRFy7BR15d45SGcZpBSdYYHGI/s1600/creating+window+form+project.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Creating Window Form Project&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiACX8SXFjpL59bBtqjtB74BTRs2Pwpw-MQAbsyXcylEWrBAprAL0x1qM2BPl8sJeUB6qyFDRNg9o6gc6ukZSmBeH5MXmTMsTZLYXQhGGmJjUj7dlmAI6qRFy7BR15d45SGcZpBSdYYHGI/s1600/creating+window+form+project.jpg&quot; height=&quot;120&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkg0UFEQBCVZrTY7sum3W6tYrnKa9kQQHi2gyyqzM5Ki_lla3ppBUV7iw5J-3aghYJC4KFyLM_xRF1FIZ6TmCNYWgELXktTpJqROM0bNBFezdIE85hKhhCO2-P7A_GhADzZ7hZvbN-g14/s1600/window+form+project.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Create Window Form&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkg0UFEQBCVZrTY7sum3W6tYrnKa9kQQHi2gyyqzM5Ki_lla3ppBUV7iw5J-3aghYJC4KFyLM_xRF1FIZ6TmCNYWgELXktTpJqROM0bNBFezdIE85hKhhCO2-P7A_GhADzZ7hZvbN-g14/s1600/window+form+project.jpg&quot; height=&quot;120&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Open Microsoft Visual Studio 2010.&lt;/li&gt;
&lt;li&gt;Click on ―&amp;gt; File ―&amp;gt; New ―&amp;gt; Project.&lt;/li&gt;
&lt;li&gt;Select the language as Visual C#.&lt;/li&gt;
&lt;li&gt;Select the project type as Windows Forms Application.&lt;/li&gt;
&lt;li&gt;Enter the name and location of the project.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Then it will create a windows forms application, along with a form, named Form1.&lt;/li&gt;
&lt;li&gt;Then the screen looks like this:&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;float:left;&quot;&gt;&lt;b&gt;Next : &lt;/b&gt;&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/development-of-form.html&quot;&gt;Development of Form&lt;/a&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/windows-forms-applications_31.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0SCY3lvFmM-8Rb5HuQ9z6sI1cgVQSHluLE2wAkO9-t7Zd_IsAcYwz7tvWlewtViXp6NBM_ayzYmTlyx1ycBDNI4eK3-hLkno6euJKuNvvDhfOzY3JHsYtu2ISTzBQxH8zXctnbWNU68Q/s72-c/cui.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-4790107552862715589</guid><pubDate>Mon, 24 Mar 2014 17:09:00 +0000</pubDate><atom:updated>2015-06-24T02:01:55.693-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Linq</category><category domain="http://www.blogger.com/atom/ns#">Linq syntax</category><category domain="http://www.blogger.com/atom/ns#">Linq to Arrays</category><category domain="http://www.blogger.com/atom/ns#">linq to objects</category><title>LINQ</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;divh1&quot;&gt; LINQ &lt;/div&gt;&lt;br/&gt;
&lt;ol&gt;
&lt;li&gt;LINQ stands for &quot;Language Integrated Query&quot;.&lt;/li&gt;
&lt;li&gt;This concept is introduced in .NET Framework 3.5.&lt;/li&gt;
&lt;li&gt;This is a query writing technology.&lt;/li&gt;
&lt;li&gt;This is most useful while working large amount of data in the live projects.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt;INTRODUCTION:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;In relational database system, data is organized in the form of tables, on which you can write  SQL  queries  to  retrieve  the  required  data  according  to  the  requirement  in  the application.&lt;/li&gt;
&lt;li&gt;But you can‘t write a query on the non-database data, which in the form of objects in the application. There, you can write the queries using the new concept called &quot;LINQ&quot;.&lt;/li&gt;
&lt;li&gt;You can write queries on arrays, objects, databases and XML using LINQ.&lt;/li&gt;
&lt;li&gt;Note:  Before  writing  the  LINQ  queries,  you  should  import  the  System.Linq namespace..&lt;/li&gt;
&lt;/ol&gt;
The following example shows a small demo on LINQ:&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;PROGRAM FOR LINQ TO ARRAYS&lt;/div&gt;   
&lt;pre class=&quot;brush:csharp;&quot;&gt;                                                    
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LINQtoArrayDemo
{
    class Program
     {
       static void Main(string[] args)
       {
         //data source
          int[] numbers = { 2, 12, 10, 5, 15, 4, 62 };
       //ling query
         IEnumerable&lt;int&gt; result = from n in numbers where n &lt;= 10 select n;
       //output
        foreach (var x in result)
        Console.WriteLine(x);
        Console.Read();
      }
    }
} 
&lt;/pre&gt;
&lt;p&gt;In the above application, the array contains few numbers. After executing the query, you got  only  the  numbers, which  are  less  than  10. In  this  manner,  you  can  execute  the  queries  on data sets (after learning ADO.NET) also.&lt;/p&gt;
&lt;div class=&quot;divh1&quot;&gt; LINQ SYNTAX: &lt;/div&gt;
&lt;br/&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXrAFlA6Twuy7FEUhyphenhyphenAtjVgf4uvV3kOtsPBfmcNYcd5QT5oPk30g-9fF1vsYDdkFL16quzQ2Ujj0AeNp7E9gUOkei3C3zIOJEDBSxrCtqDDgonEdZBcGniGT0NY5pMblNDRo3ywDZ7_1c/s1600/Linq+Sytax.jpg&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXrAFlA6Twuy7FEUhyphenhyphenAtjVgf4uvV3kOtsPBfmcNYcd5QT5oPk30g-9fF1vsYDdkFL16quzQ2Ujj0AeNp7E9gUOkei3C3zIOJEDBSxrCtqDDgonEdZBcGniGT0NY5pMblNDRo3ywDZ7_1c/s200/Linq+Sytax.jpg&quot; width=&quot;450px&quot; height=&quot;30px&quot;/&gt;&lt;/a&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:300,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;THE ABOVE SYNTAX CONSISTS OF 7 CLAUSES.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;from clause&lt;/li&gt;
&lt;li&gt;in clause&lt;/li&gt;
&lt;li&gt;let clause&lt;/li&gt;
&lt;li&gt;where clause&lt;/li&gt;
&lt;li&gt;orderby clause&lt;/li&gt;
&lt;li&gt;select clause&lt;/li&gt;
&lt;li&gt;group by clause&lt;/li&gt;
&lt;li&gt;Mandatory clauses:&lt;/li&gt;
&lt;li&gt;from clause&lt;/li&gt;
&lt;li&gt;in clause&lt;/li&gt;
&lt;li&gt;select clause&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt; CLAUSE &lt;/div&gt;
&lt;p&gt;Def of Clause: A part of the query.&lt;/p&gt;
&lt;div class=&quot;divh1&quot;&gt;UNDERSTANDING CLAUSES:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;from clause:&lt;/b&gt; This is used to specify the iteration variable name. This acts as alias name for the data source.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;in clause:&lt;/b&gt; This is used to specify the main data source for the query.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;let clause (optional):&lt;/b&gt; This is used to declare a new identifier with a value, that is to be used during the query execution.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;where  clause  (optional):&lt;/b&gt;  This  is  most  frequently  used  optional  clause,  using  which you can specify the condition in the query.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;orderby clause (optional):&lt;/b&gt; This is used to specify the sorting expression if required.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;select clause:&lt;/b&gt; This is used to specify the object, which is required in the query results.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;group by (optional):&lt;/b&gt; This is similar to ―group by‖ clause in SQL. This retrieves grouped data, based on a column.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Note: &lt;/b&gt; The  result  of  a  LINQ  query  should  be  assigned  into  a  IEnumerable&lt;data type&gt;  type variable. IEnumerable is an interface.&lt;/p&gt;
&lt;span style=&quot;color:red;&quot;&gt;Library: System.Collections.Generic.IEnumerable&lt;/span&gt;
&lt;div class=&quot;divh1&quot;&gt;PROGRAM FOR LINQ TO OBJECTS &lt;/div&gt;                                                   
&lt;pre class=&quot;brush:csharp;&quot;&gt;
Student.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LINQtoObjectsDemo
{
   class Student
    {
      //fields
        public int StudentID;
        public string Name;
        public string Course;
        public int Marks;
     //constructor
       public Student(int StudentID, string Name, string Course, int Marks)
        {
          this.StudentID = StudentID;
          this.Name = Name;
          this.Course = Course;
          this.Marks = Marks;
        }
    }
}

Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LINQtoObjectsDemo
{
   class Program
    {
      static void Main(string[] args)
      {
        //data source
          Student[] stu = { new Student(101, &quot;Prakash&quot;, &quot;MBA&quot;, 765),
          new Student(102, &quot;Pradeep&quot;, &quot;MBA&quot;, 471),
          new Student(103, &quot;Pushpa&quot;, &quot;Msc&quot;, 590),
          new Student(104, &quot;Purna&quot;, &quot;MCA&quot;, 223),
          new Student(105, &quot;Purnima&quot;, &quot;MCA&quot;, 450)};
       //linq query with where clause
         IEnumerable&lt;Student&gt; result1 = from s in stu where s.Course == &quot;MCA&quot; select s;                                                                                          Console.WriteLine(&quot;MCA Students:&quot;);
         foreach (Student r in result1)
         Console.WriteLine(r.StudentID + &quot;, &quot; + r.Name + &quot;, &quot; + r.Course + &quot;, &quot; + r.Marks);
      //linq query with compound where clause
        IEnumerable&lt;Student&gt; result2 = from s in stu where s.Name.EndsWith(&quot;a&quot;) &amp;&amp; s.Marks&gt;=400 &amp;&amp;                                                             s.Marks&lt;=600 select s;
        Console.WriteLine(&quot;\nStudents whose name ends with &#39;a&#39;, and marks is &gt;=400 and &lt;=600:&quot;);
        foreach (Student r in result2)
        Console.WriteLine(r.StudentID + &quot;, &quot; + r.Name + &quot;, &quot; + r.Course + &quot;, &quot; + r.Marks);

     //linq query with let and where clauses
       IEnumerable&lt;Student&gt; result3 = from s in stu let avg = s.Marks / 10 where avg &lt; 35 select s;
       Console.WriteLine(&quot;\nFailed Students:&quot;);
       foreach (Student r in result3)
       Console.WriteLine(r.StudentID + &quot;, &quot; + r.Name + &quot;, &quot; + r.Course + &quot;, &quot; + r.Marks);
     //linq query with orderby clause
       IEnumerable&lt;Student&gt; result4 = from s in stu orderby s.Marks select s;
       Console.WriteLine(&quot;\nStudents (sort on marks):&quot;);
       foreach (Student r in result4)
       Console.WriteLine(r.StudentID + &quot;, &quot; + r.Name + &quot;, &quot; + r.Course + &quot;, &quot; + r.Marks);
     //linq query with orderby clause (descending)
       IEnumerable&lt;Student&gt; result5 = from s in stu orderby s.Marks descending select s;
       Console.WriteLine(&quot;\nStudents (sort on marks - descending):&quot;);
       foreach (Student r in result5)
       Console.WriteLine(r.StudentID + &quot;, &quot; + r.Name + &quot;, &quot; + r.Course + &quot;, &quot; + r.Marks);
    //linq query with group clause
       IEnumerable&lt;IGrouping&lt;string,Student&gt;&gt; result6 = from s in stu group s by s.Course;
       Console.WriteLine(&quot;\nStudents with grouping:&quot;);
       foreach (IGrouping&lt;string, Student&gt; StuGrp in  result6)
         {
           Console.WriteLine(StuGrp.Key + &quot;:&quot;);
           foreach (Student r in StuGrp)
           Console.WriteLine(&quot; &quot; + r.StudentID + &quot;, &quot; + r.Name + &quot;, &quot; + r.Course + &quot;, &quot; + r.Marks);         
         }
        Console.Read();
      }
   }
}
&lt;/pre&gt;
&lt;div align=&quot;center&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/linq_24.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXrAFlA6Twuy7FEUhyphenhyphenAtjVgf4uvV3kOtsPBfmcNYcd5QT5oPk30g-9fF1vsYDdkFL16quzQ2Ujj0AeNp7E9gUOkei3C3zIOJEDBSxrCtqDDgonEdZBcGniGT0NY5pMblNDRo3ywDZ7_1c/s72-c/Linq+Sytax.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-2995921639177089358</guid><pubDate>Sun, 09 Mar 2014 16:30:00 +0000</pubDate><atom:updated>2015-03-15T14:08:35.144-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">BreakPoint</category><category domain="http://www.blogger.com/atom/ns#">Bug</category><category domain="http://www.blogger.com/atom/ns#">Debug</category><category domain="http://www.blogger.com/atom/ns#">Immediate Window</category><category domain="http://www.blogger.com/atom/ns#">Local Window</category><title>Break Point</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/debug.html&quot;&gt;EventLog&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/break-point.html&quot;&gt;Break Point&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;Break Point&lt;/div&gt;&lt;br/&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;
&lt;/div&gt;

&lt;p&gt;
&lt;b&gt;Bug:&lt;/b&gt; : An error.&lt;br/&gt;
&lt;b&gt;Debugging: Removing the bugs.&lt;/p&gt;
&lt;p&gt;
NET  offers  more  features  for  debugging.  To  start  with  the  .NET  application  debugging,  you should create the break points.
&lt;/p&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguIEhfNaL8XFcPIa4tCTl42trqdPdeJNBNTnWVJCFf-yyPpvs-I-L3buEZ90J4uBlGK3DcyvScGqKSEn-vRYfdrNlaSLmG-u4MbriGQT3mEtp6lK1SHJrg8gBrFZEsCNNnzwoB_v8B_Qc/s1600/BreakPoint.jpg&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguIEhfNaL8XFcPIa4tCTl42trqdPdeJNBNTnWVJCFf-yyPpvs-I-L3buEZ90J4uBlGK3DcyvScGqKSEn-vRYfdrNlaSLmG-u4MbriGQT3mEtp6lK1SHJrg8gBrFZEsCNNnzwoB_v8B_Qc/s200/BreakPoint.jpg&quot; /&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyVhT6Y8BoLuvKoOosO5TLooWyBxvlVo0zJgYUKNSuTYs4bbavFJsGwdOZ6dyX6wocHCVoQxvuUNJv54rY-g4trUAyvbCJFK_8PtcMvOFv-Agna89oDQrSepIHK97Dvv05ZXXLtHVDlxY/s1600/Demo+of+BreakPoint.jpg&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyVhT6Y8BoLuvKoOosO5TLooWyBxvlVo0zJgYUKNSuTYs4bbavFJsGwdOZ6dyX6wocHCVoQxvuUNJv54rY-g4trUAyvbCJFK_8PtcMvOFv-Agna89oDQrSepIHK97Dvv05ZXXLtHVDlxY/s200/Demo+of+BreakPoint.jpg&quot; /&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;b&gt;&lt;span style=&quot;color:Red;&quot;&gt;Definition of Break Point:&lt;/span&gt;&lt;/b&gt;  A  break  point  is  a  point  in  the  program,  where  the  application execution control pauses until you press F10 key. In the code, that line is highlighted with red color.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color:Red;&quot;&gt; Creating a break point: &lt;/span&gt;&lt;/b&gt; Just click on the left side margin of the required line.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color:red;&quot;&gt;Running  the  Application  with  Break  Points: &lt;/span&gt;&lt;/b&gt; Just  press  F5  key.  The application will be executed normally. But whenever the execution control reaches to the break point line, automatically the execution will be paused and the break point line will be highlighted with yellow color. To continue wit h the execution to the next statement, press “F10” key.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color:red;&quot;&gt;Observing  the  values  of  variables  or  objects: &lt;/span&gt;&lt;/b&gt; While  you  are  executing  the application  with  break  points,  to  know  the  current  value  of  any  variable  or  object, just place the mouse pointer over it.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;divh1&quot;&gt; Immediate window &lt;/div&gt;
&lt;br/&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhST-vdmt6lDmEveLCchfGP0cxib5S1_j-oVL5pRn8L1hesLex4C_UknxSZa2lSgqq9hyO2bbOwMUh9VJpSNqnMIMYJG6A2g6-UcqsixMr0k6tHwGxqzAjplJIxTOEap6nLlrXmAoCNKQA/s1600/Immediate+Window.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhST-vdmt6lDmEveLCchfGP0cxib5S1_j-oVL5pRn8L1hesLex4C_UknxSZa2lSgqq9hyO2bbOwMUh9VJpSNqnMIMYJG6A2g6-UcqsixMr0k6tHwGxqzAjplJIxTOEap6nLlrXmAoCNKQA/s1600/Immediate+Window.jpg&quot; width=&quot;300px&quot; height=&quot;250px&quot;/&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:300,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;ol&gt;
&lt;li&gt;The Immediate window resides at bottom side of Visual Studio IDE. It will automatically appear at run time. If not, press Ctrl + Alt + I.&lt;/li&gt;
&lt;li&gt;This window is used to know the current values of the required variables, objects or data members, which is not possible to find the value by just placing the mouse pointer over it.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt;Locals window&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;It automatically displays all the current local variables along with their values.&lt;/li&gt;
&lt;li&gt;To open this window, while running the application, get into the Visual Studio and press Ctrl+D and the L.&lt;/li&gt;
&lt;/ul&gt;

&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/debug.html&quot;&gt;EventLog&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/break-point.html&quot;&gt;Break Point&lt;/a&gt;
&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/break-point.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguIEhfNaL8XFcPIa4tCTl42trqdPdeJNBNTnWVJCFf-yyPpvs-I-L3buEZ90J4uBlGK3DcyvScGqKSEn-vRYfdrNlaSLmG-u4MbriGQT3mEtp6lK1SHJrg8gBrFZEsCNNnzwoB_v8B_Qc/s72-c/BreakPoint.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-7383987855044939957</guid><pubDate>Sun, 09 Mar 2014 16:13:00 +0000</pubDate><atom:updated>2015-03-15T14:21:45.564-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Event Log</category><category domain="http://www.blogger.com/atom/ns#">Program of EventLog</category><title>Debug</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/debug.html&quot;&gt;Event Log&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/break-point.html&quot;&gt;Break Point&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt; EventLog&lt;/div&gt;&lt;br/&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;br/&gt;
&lt;ol&gt;
&lt;li&gt;EventLog is a service, offered by Microsoft Windows.&lt;/li&gt;
&lt;li&gt;It is used to store the exceptions / warnings / any messages permanently, even though the application is closed.&lt;/li&gt;
&lt;li&gt;Let us imagine you have done a live project and issue it to the client.&lt;/li&gt;
&lt;li&gt;At run time there may be so many exceptions. But after few days, you went to the client location, and want to know what kind of run time errors were coming in your application.&lt;/li&gt;
&lt;li&gt;Then no information is available with you.&lt;/li&gt;
&lt;li&gt;So,  in  this  case,  you  require  some  thing,  that  stores  the  exceptions  information automatically,  for  further  information,  which  helps  you  while  you  want  to  debug  your application and develop a next version.&lt;/li&gt;
&lt;li&gt;That kind of service is EventLog.&lt;/li&gt;
&lt;li&gt;To open EventLog and view the current events: Start –&gt;  Control Panel –&gt;  Administrative Tools      –&gt;  Event Viewer.&lt;/li&gt;
&lt;/ol&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpGbI1EkUPK27GxdaTn8wplHYBMDFztW9poEHTrEytVSZ2GK07FsElyVcyt4NDIIhyUlNVCUOFNR48csID9F-WsX8MKc8CSYnzv4nJgOox6krHaC8BcnJmJZIOPtYwfIHRau0fuJznzE4/s1600/EventLog.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpGbI1EkUPK27GxdaTn8wplHYBMDFztW9poEHTrEytVSZ2GK07FsElyVcyt4NDIIhyUlNVCUOFNR48csID9F-WsX8MKc8CSYnzv4nJgOox6krHaC8BcnJmJZIOPtYwfIHRau0fuJznzE4/s1600/EventLog.jpg&quot; width=&quot;300px&quot; height=&quot;250px&quot; /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:300,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;&lt;b&gt;Writing a new entry programmatically:&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color:Red;&quot;&gt;System.Diagnostics.EventLog.WriteEntry(&quot;project name&quot;, &quot;message&quot;, EventLogEntryType.Error);&lt;/span&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;div class=&quot;divh1&quot;&gt; Program of Event Log &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
namespace EventLogDemo
{
class Program
 {
  static void Main(string[] args)
  {
   try
   {
    string filename = &quot;c:\\sample.txt&quot;;
    StreamReader sr = new StreamReader(filename);
    string content = sr.ReadToEnd();
    Console.WriteLine(&quot;The file content is:\n&quot;);
    Console.WriteLine(content);
   }
  catch (Exception ex)
  {
   string EventMsg = ex.Message + &quot;\n\n&quot; + ex.StackTrace;
   EventLog.WriteEntry(&quot;My Sample Project 1.0&quot;, EventMsg, 
   EventLogEntryType.Error);
   Console.WriteLine(ex.Message);
  }
 finally
  {
   Console.WriteLine(&quot;Press any key to exit..&quot;);
   Console.Read();
  } 
  }
 }
}
&lt;/pre&gt;

&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/debug.html&quot;&gt;Event Log&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/break-point.html&quot;&gt;Break Point&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/debug.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpGbI1EkUPK27GxdaTn8wplHYBMDFztW9poEHTrEytVSZ2GK07FsElyVcyt4NDIIhyUlNVCUOFNR48csID9F-WsX8MKc8CSYnzv4nJgOox6krHaC8BcnJmJZIOPtYwfIHRau0fuJznzE4/s72-c/EventLog.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-6844365919761525697</guid><pubDate>Sun, 09 Mar 2014 16:02:00 +0000</pubDate><atom:updated>2015-03-15T14:30:56.347-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Anonymous Method</category><category domain="http://www.blogger.com/atom/ns#">Program of Anonymous</category><category domain="http://www.blogger.com/atom/ns#">Program of Speech Translator</category><category domain="http://www.blogger.com/atom/ns#">Speech Translator</category><title>Anonymous Method &amp; Speech Translator</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;
&lt;/div&gt;
This is used to create a method, without any name.&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt; Syntax: &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
delegate()
{
 //some code
}
&lt;/pre&gt;
&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt;PROGRAM OF ANONYMOUS METHOD&lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace AnonymousMethodsDemo
{
class ThreadingDemo
  {
   public void Display(string name)
    {
      Thread th1 = new Thread(delegate()
      {
       while (true)
        {
          Console.WriteLine(&quot;Welcome to &quot; + name);
          Thread.Sleep(500);
         }
     });
    th1.Start();
   }
 }

  class Program
  {
   static void Main(string[] args)
   {
     string name;
     Console.WriteLine(&quot;Enter your name:&quot;);
      name = Console.ReadLine();
      ThreadingDemo td = new ThreadingDemo();
      td.Display(name);
      Console.Read();
    }
  }
} 
&lt;/pre&gt;
&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt; SPEECH TRANSLATION&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;This is to translate the text as speech.&lt;/li&gt;
&lt;li&gt;This makes us to listen a voice from the speakers that reads some specified text.&lt;/li&gt;
&lt;li&gt;Library: System.Speech.Synthesis.SpeechSynthesizer&lt;/li&gt;
&lt;li&gt;This class used to speak the required text through the speakers.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;divh1&quot;&gt; Implementation:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
Create the object of SpeechSynthesizer class:&lt;/li&gt;
 &lt;span style=&quot;color:red;&quot;&gt; SpeechSynthesizer ss = new SpeechSynthesizer(); &lt;/span&gt;
&lt;li&gt; Set the volume (1 to 100):&lt;/li&gt;
 &lt;span style=&quot;color:red;&quot;&gt; ss.Volume = n; &lt;/span&gt;
&lt;li&gt; Set the speed of speaking (-10 to +10):&lt;/li&gt;
 &lt;span style=&quot;color:red;&quot;&gt; ss.Rate = n;&lt;/span&gt;
&lt;li&gt;Change the voice gender and age:&lt;/li&gt;
 &lt;span style=&quot;color:red;&quot;&gt; ss.SelectVoiceByHints(VoiceGender.xxxx, VoiceAge.xxxx);&lt;/span&gt;
&lt;li&gt; Speak the text:&lt;/li&gt;
 &lt;span style=&quot;color:red;&quot;&gt; ss.SpeakAsync(―message‖);&lt;/span&gt;
&lt;/ol&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt; PROGRAM OF SPEECH TRANSLATOR&lt;/div&gt;                                                       
&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Speech.Synthesis;
namespace SpeechTranslationDemo
{
class Program
 {
  static void Main(string[] args)
  {
   Console.WriteLine(&quot;Enter text to speak:&quot;);
   string TextToSpeak = Console.ReadLine();
   SpeechSynthesizer ss = new SpeechSynthesizer();
   ss.Volume = 100; //1 to 100 
   ss.Rate = -3; // -10 to +10 
   ss.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Child);
   ss.SpeakAsync(TextToSpeak);
   Console.Read();
  }
 }
}
&lt;/pre&gt;
&lt;div align=&quot;center&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/anonymous-method-speech-translator.html</link><author>noreply@blogger.com (fdfsdf)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-6295691792302238821</guid><pubDate>Sun, 09 Mar 2014 15:50:00 +0000</pubDate><atom:updated>2015-03-15T15:01:31.399-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Garbage Collector</category><category domain="http://www.blogger.com/atom/ns#">Heap</category><category domain="http://www.blogger.com/atom/ns#">Memory Management</category><category domain="http://www.blogger.com/atom/ns#">Program of System.Object</category><category domain="http://www.blogger.com/atom/ns#">RAM</category><category domain="http://www.blogger.com/atom/ns#">Reference type</category><category domain="http://www.blogger.com/atom/ns#">Stack</category><category domain="http://www.blogger.com/atom/ns#">System.Object</category><category domain="http://www.blogger.com/atom/ns#">Value Type</category><title>Memory Management</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;divh1&quot;&gt; Memory Management &lt;/div&gt;&lt;br/&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC-gMLvwBKtFeSLXwET8tYtf6azEXnuf7ZMSN7EdB5dFQIJ_SyCDy9NyQ9hSHOFTm3ogFIbmsCAFC2BZAs1938ifj9pDq06OpuhA7FYGEquxrvBcMgxmGcYg4rI4k3IKz3qBgb5sgIYmk/s1600/RAM.jpg&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC-gMLvwBKtFeSLXwET8tYtf6azEXnuf7ZMSN7EdB5dFQIJ_SyCDy9NyQ9hSHOFTm3ogFIbmsCAFC2BZAs1938ifj9pDq06OpuhA7FYGEquxrvBcMgxmGcYg4rI4k3IKz3qBgb5sgIYmk/s200/RAM.jpg&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Every application requires some amount of memory to run.&lt;/li&gt;
&lt;li&gt;That memory will be allocated in the primary memory (RAM).&lt;/li&gt;
&lt;li&gt;For every variable, individual memory will be allocated.&lt;/li&gt;
&lt;li&gt;The RAM contains two memory locations.
 &lt;ul&gt;&lt;li&gt;--&gt;  Stack&lt;/li&gt;
     &lt;li&gt;--&gt;  Heap&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Now,  we  need  to  understand,  where  the application  memory  is  getting  allocated  in  the RAM.&lt;/li&gt;
&lt;li&gt;The  storage  area  in  the  RAM  depends  on  the data  type  that  you  are  using  for  declaring  the variable in the program.&lt;/li&gt;
&lt;li&gt;The data types are two types in C#
 &lt;ul&gt;&lt;li&gt;--&gt;   Value Types&lt;/li&gt;
     &lt;li&gt;--&gt;   Reference Types&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;divh1&quot;&gt; Value Type&lt;/div&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiW33YA5Ga8UlRvf6IxoyfziHE1ZYDdt8Ug2riREnHJ_LpYq4Yuwf5R-y1bNhiHRlyu1i70Apz2oYehQrVY9oRO6RyjgvYenj4S-H6kB3kq6hIEhBYmFKcFQOU_GkW32TlxnuF8eGs5u2I/s1600/value+type.jpg&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiW33YA5Ga8UlRvf6IxoyfziHE1ZYDdt8Ug2riREnHJ_LpYq4Yuwf5R-y1bNhiHRlyu1i70Apz2oYehQrVY9oRO6RyjgvYenj4S-H6kB3kq6hIEhBYmFKcFQOU_GkW32TlxnuF8eGs5u2I/s200/value+type.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Def: &lt;/b&gt; Whenever  a  data  type  is  designed  based  on  a structure,  it  can  be  called  as Value Type.&lt;/li&gt;
&lt;li&gt;All the standard data types built based on structures.&lt;/li&gt;
&lt;li&gt;You can see the list of data types and respective structures here:&lt;/li&gt;
&lt;li&gt;So finally, the following are value types in C#:
&lt;ul&gt;
&lt;li&gt;Structures&lt;/li&gt;
&lt;li&gt;Enumerations&lt;/li&gt;
&lt;li&gt;sbyte, byte, short, ushort, int, uint, long, ulong, float, double, decimal, bool, char, decimal, DateTime &lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Note 1: &lt;/b&gt;The value types can‘t be inherited.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Note  2: &lt;/b&gt;All  the  value  types  (structures  and  enumerations),  are  derived  from  a common base class called System.ValueType.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt; REFERENCE TYPES:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Def: &lt;/b&gt;Whenever  a  data  type  is  designed  based  on  a  class,  it  can  be  called  as Reference Type.&lt;/li&gt;
&lt;li&gt;The following are the reference types in C#:
 &lt;ul&gt;&lt;li&gt;Classes&lt;/li&gt;
     &lt;li&gt;Interfaces&lt;/li&gt;
     &lt;li&gt;String, Object&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Reference types support inheritance. &lt;/li&gt;
&lt;li&gt;The Value Type variables will be allocated in the Stack.&lt;/li&gt;
&lt;li&gt;The Reference Type variables (objects) will be allocated in the Heap.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt; THE “SYSTEM.OBJECT” CLASS:&lt;/div&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:300,&quot;height&quot;:600,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;This  class  acts  as  super  class  for  all  other  classes  (pre-defined  /  user-defined classes).&lt;/li&gt;
&lt;li&gt;So, it can be called as Ultimate base class.&lt;/li&gt;
&lt;li&gt;The Object class offers the following methods&lt;/li&gt;
&lt;/ul&gt;
&lt;div valign=&quot;top&quot;&gt;
&lt;table width=&quot;auto;&quot; height=&quot;500px&quot;&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtA_oO7GmpOZGqfJUuhJb235XLJYD9h-pdWVjwA0N73GIgSdoqVDXDk1pkZYV-7ktVu5EbMtqFUWiYbQ5hTtYR0ti1yMLF8GIjZKevOtUwyXDmOKxCe4kaZV-kjiUN1IEyPkc8JLrmiEY/s1600/System.object+class.jpg&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtA_oO7GmpOZGqfJUuhJb235XLJYD9h-pdWVjwA0N73GIgSdoqVDXDk1pkZYV-7ktVu5EbMtqFUWiYbQ5hTtYR0ti1yMLF8GIjZKevOtUwyXDmOKxCe4kaZV-kjiUN1IEyPkc8JLrmiEY/s200/System.object+class.jpg&quot; width=&quot;300px&quot; height=&quot;250px&quot;/&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieLq0zkG0Ptru5n4yFyH2mfXDG-rDjMAMcaCxZTJ6aOKIyIbRkQ3_3cYP7a4SBuDh2sMuEgHnkG4dTs6RhsdW2KsT2CgsDeJnq0hNgPQJL20TkpHEVadC6QYDUYgMkGZ7hYEWpD3gOW8A/s1600/System.object+table.jpg&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieLq0zkG0Ptru5n4yFyH2mfXDG-rDjMAMcaCxZTJ6aOKIyIbRkQ3_3cYP7a4SBuDh2sMuEgHnkG4dTs6RhsdW2KsT2CgsDeJnq0hNgPQJL20TkpHEVadC6QYDUYgMkGZ7hYEWpD3gOW8A/s200/System.object+table.jpg&quot; width=&quot;300px&quot; height=&quot;250px&quot;/&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt; PROGRAM OF SYSTEM.OBJECT CLASS  &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ObjectClassMethods
{
class Program
 {
  static void Main(string[] args)
  {
   int x = 100;
   int y = 100;
   Console.WriteLine(&quot;x is &quot; + x);
   Console.WriteLine(&quot;y is &quot; + y);
   Console.WriteLine();
   if (x.Equals(y))
   Console.WriteLine(&quot;x is equal to y&quot;);
  else
   Console.WriteLine(&quot;x is not equal to y&quot;);
   Console.WriteLine(&quot;\nx is the type of &quot; + x.GetType());
   string s = x.ToString();
   Console.WriteLine(&quot;\nThe integer value after converting into string is: &quot; + s);
   Console.Read();
  }
 }
} 
&lt;/pre&gt;
&lt;div class=&quot;divh1&quot;&gt; GARBAGE COLLECTOR:&lt;/div&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl2t5Mc0YODQrEjHflaRDhTvXcYb3ANy4hoRswDuX13ZA20STrrSVuBJaMueHNnU2N-LUD0FIdP9nedgUNcP6JXTczYCTQdNmqQJNKP4ZGUX3vktZQSBbKKkOr2b_8UTTdnYlDXge4IWg/s1600/GC.jpg&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl2t5Mc0YODQrEjHflaRDhTvXcYb3ANy4hoRswDuX13ZA20STrrSVuBJaMueHNnU2N-LUD0FIdP9nedgUNcP6JXTczYCTQdNmqQJNKP4ZGUX3vktZQSBbKKkOr2b_8UTTdnYlDXge4IWg/s200/GC.jpg&quot; height=&quot;200px&quot; width=&quot;120px&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;This is one of the components of CLR (Common Language Runtime).&lt;/li&gt;
&lt;li&gt;This  component  is  dedicated  for  de-allocating  the  un-used  memory  of  the application, automatically.&lt;/li&gt;
&lt;li&gt;This uses Mark and Compact algorithm for clearing the un-used memory.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Mark:&lt;/b&gt; Markup the un-used objects and push those objects towards up.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Compact: &lt;/b&gt;Clear the marked objects memory.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt;  The  above  functionality  is  in-built  in  Garbage  collector component.  Anyhow,  there  is  a provision for the programmer to command the garbage collector to  perform garbage collection at run time, programmatically. Then use the following method from System.GC  class.
&lt;span style=&quot;color:Red;&quot;&gt;Syn: System.GC.Collect();&lt;/span&gt;&lt;/p&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;br/&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async&gt;&lt;/script&gt;

&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/memory-management.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC-gMLvwBKtFeSLXwET8tYtf6azEXnuf7ZMSN7EdB5dFQIJ_SyCDy9NyQ9hSHOFTm3ogFIbmsCAFC2BZAs1938ifj9pDq06OpuhA7FYGEquxrvBcMgxmGcYg4rI4k3IKz3qBgb5sgIYmk/s72-c/RAM.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-279568509728439531</guid><pubDate>Sun, 09 Mar 2014 15:22:00 +0000</pubDate><atom:updated>2015-03-15T15:44:26.545-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Assembly</category><category domain="http://www.blogger.com/atom/ns#">Class Libraries</category><category domain="http://www.blogger.com/atom/ns#">Global Assembly Cache</category><category domain="http://www.blogger.com/atom/ns#">Strong Key Name</category><category domain="http://www.blogger.com/atom/ns#">Type of Assemblies</category><title>Assembly</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/assembly.html&quot;&gt;Assembly&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/implementation-of-shared-assemblies.html&quot;&gt;Implementation of Share Assemblies&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/shared-assemblies.html%20Done&quot;&gt;Shared Assemblies&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt; Assembly&lt;/div&gt;&lt;br/&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Def: &lt;/b&gt;An assembly is the container of compiled code of .NET applications.&lt;/li&gt;
&lt;li&gt;It contains the code in MSIL (Microsoft Intermediate Language) language.&lt;/li&gt;
&lt;li&gt;At run time, it will be compiled by CLR‘s JIT compiler into machine language.&lt;/li&gt;
&lt;li&gt;The assembly file (with .exe or .dll extension) will be generated in the project folder  \bin folder, after compilation.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; TYPES OF ASSEMBLIES (BASED ON EXTENSION):&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Executable Assemblies / Process Assemblies / Private Assemblies (with .EXE extension)
 &lt;p&gt;a. This is generated with&lt;/p&gt;
 &lt;ul&gt;
&lt;li&gt;Console Applications&lt;/li&gt;
&lt;li&gt;Smart Device Applications&lt;/li&gt;
&lt;li&gt;Windows Applications&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;p&gt;b. These files are ready for execution. You can execute those by simply double clicking.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Limitation:&lt;/b&gt; The code in this assembly is not accessible from other projects.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt; Library  Assemblies  /  Re-usable  Assemblies  /  Shared  Assemblies  (with  .DLL extension)
 &lt;p&gt;i. This is generated with&lt;/p&gt;
  &lt;ul&gt;
   &lt;li&gt;Class Library&lt;/li&gt;
   &lt;li&gt;Windows Forms Control Library&lt;/li&gt;
  &lt;/ul&gt;
  &lt;p&gt;ii. These are non-executable files.&lt;/p&gt;
  &lt;p&gt;&lt;b&gt;Advantage: &lt;/b&gt;The code is this assembly is accessible from other projects.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt; Overview of “Class Library” Project&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;A class library project is meant for the development of Shared Assemblies.&lt;/li&gt;
&lt;li&gt;The shared assemblies are re-usable in other applications also.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;That means the class library‘s code is re-usable in other applications, whenever required.&lt;/li&gt;
&lt;li&gt;Class library project contains only user-defined classes.&lt;/li&gt;
&lt;li&gt;Whenever  the  class  library  project  is  compiled,  a  library  assembly  file  (with  .DLLextension) will be generated in the ―bin\Debug folder.&lt;/li&gt;
&lt;li&gt;The  class  library  project  can‘t  be  executed  directly  unlike  console  applications,  windows applications etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw9zzZ1-fjR6uw1aiZPlXHG1O3q4ASa6aFd8hC8CFIX9xxx4WYsKF9Kr1sD0JPECktvl6DB3s22fp2acW4JuN87hVXqTki4OvM0mkT0k1y7DcN6dh18O-y53GyF5n1fiufGK2A01gf6e8/s1600/Class+Library.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Class Library&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw9zzZ1-fjR6uw1aiZPlXHG1O3q4ASa6aFd8hC8CFIX9xxx4WYsKF9Kr1sD0JPECktvl6DB3s22fp2acW4JuN87hVXqTki4OvM0mkT0k1y7DcN6dh18O-y53GyF5n1fiufGK2A01gf6e8/s1600/Class+Library.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt; Global Assembly Cache (GAC): &lt;/div&gt;
&lt;p&gt;All the shared assemblies should be saved in the GAC. GAC offers the following advantages.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Unique identification of the shared assemblies.&lt;/li&gt;
&lt;li&gt;Avoids the DLL hell (replacement of an assembly related to one application, by another application).&lt;/li&gt;
&lt;li&gt;Faster accessibility.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To view the currently installed assemblies in the GAC, open the following folder &lt;b&gt;C:\windows\assembly&lt;/b&gt; The  above  folder  is  able  to  contain  multiple  dll  files  with  same  name,  with  different versions.&lt;/p&gt;
&lt;div class=&quot;divh1&quot;&gt; STRONG  NAME  KEYS  (SNK):  &lt;/div&gt;
&lt;p&gt;The  strong  name  key  is  a  file,  which  acts  as  a  unique identifier,  for  the  shared  assemblies,  stored  in  the  GAC.  In  other  words,  GAC  recogniz es  the assembly with this strong name only.&lt;/p&gt;

&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/assembly.html&quot;&gt;Assembly&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/implementation-of-shared-assemblies.html&quot;&gt;Implementation of Share Assemblies&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/shared-assemblies.html%20Done&quot;&gt;Shared Assemblies&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/assembly.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw9zzZ1-fjR6uw1aiZPlXHG1O3q4ASa6aFd8hC8CFIX9xxx4WYsKF9Kr1sD0JPECktvl6DB3s22fp2acW4JuN87hVXqTki4OvM0mkT0k1y7DcN6dh18O-y53GyF5n1fiufGK2A01gf6e8/s72-c/Class+Library.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-627323020014955177</guid><pubDate>Sun, 09 Mar 2014 15:21:00 +0000</pubDate><atom:updated>2015-03-15T15:53:44.544-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Create Library</category><category domain="http://www.blogger.com/atom/ns#">GAC</category><category domain="http://www.blogger.com/atom/ns#">Implementing of Shared Assembly</category><category domain="http://www.blogger.com/atom/ns#">Strong Name Key</category><title>Implementation of Shared Assemblies</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/assembly.html&quot;&gt;Assembly&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/implementation-of-shared-assemblies.html&quot;&gt;Implementation of Shared Assemblies&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/shared-assemblies.html&quot;&gt;Shared Assemblies&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt; Implementation of Shared Assemblies&lt;/div&gt;&lt;br/&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;

&lt;h2&gt;&lt;i style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Create a Class Library Project.&lt;/span&gt;&lt;/i&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Create a new Class Library project.&lt;/li&gt;
&lt;li&gt;Write the required code in the project.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;i style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Create a strong name key.&lt;/span&gt;&lt;/i&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Right click on the project in the Solution Explorer and choose Properties.&lt;/li&gt;
&lt;li&gt;In the project properties, select the check box Sign the assembly.&lt;/li&gt;
&lt;li&gt;In the Choose a strong name key file‖ drop down, select &amp;lt;New&amp;gt; option.&lt;/li&gt;
&lt;li&gt;In the Create strong name key‖ dialog box, enter the name of the strong name key file.&lt;/li&gt;
&lt;li&gt;If  password  security  is  not  required,  uncheck  the  Protect  my  key  file  with  a password checkbox.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;i style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Customize the “Assembly Information” (AssemblyInfo.cs).&lt;/span&gt;&lt;/i&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;This is optional step.&lt;/li&gt;
&lt;li&gt;To  change  the  additional  details  of  the  assembly  like  displayed  name,  version, company,  copy  right,  description  etc.,  open  “AssemblyInfo.cs”  file  from  the Properties folder in the Solution Explorer.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;i style=&quot;font-weight: normal;&quot;&gt;Generate the DLL File.&lt;/i&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Build the class library project.&lt;/li&gt;
&lt;li&gt;Then  the .dll‖  file  will  be  generated  in  the  bin\debug  folder  of  your  class  library project.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span style=&quot;color: red; font-weight: normal;&quot;&gt;&lt;i&gt;Write the assembly into GAC (Global Assembly Cache).&lt;/i&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Open the following folder.&lt;/li&gt;
&lt;span style=&quot;color:red;&quot;&gt;&lt;b&gt;C:\Windows\Assembly&lt;/b&gt;&lt;/span&gt;
&lt;li&gt;Drag  and  drop  the  ―.DLL  file‖  from  ―bin\Debug‖  folder  into  the&lt;/li&gt;
 &lt;span style=&quot;color:red;&quot;&gt;&lt;b&gt;c:\windows\assembly folder.&lt;/b&gt;&lt;/span&gt;
&lt;li&gt;After dragging, the name of your shared assembly will appear in the existing list.&lt;/li&gt;
&lt;li&gt;Now, the shared assembly is ready. The rest of your work involved with the usage of the shared assembly.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; Invoke the Shared Assembly.&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Create the executable project (Console application / windows application).&lt;/li&gt;
&lt;li&gt;Click on Project – Add Reference.&lt;/li&gt;
&lt;li&gt;Click on Browse tab.&lt;/li&gt;
&lt;li&gt;Open the class library project‘s bin\Debug folder.&lt;/li&gt;
&lt;li&gt;Select the dll file and click on OK.&lt;/li&gt;
&lt;li&gt;Then  the  reference  of  the  selected  shared  assembly  will  be  added  to  the  current project.&lt;/li&gt;
&lt;li&gt;Then you can construct objects for the required class in the class library and perform required activities on that.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/assembly.html&quot;&gt;Assembly&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/implementation-of-shared-assemblies.html&quot;&gt;Implementation of Shared Assemblies&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/shared-assemblies.html&quot;&gt;Shared Assemblies&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/implementation-of-shared-assemblies.html</link><author>noreply@blogger.com (fdfsdf)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-1167027099810052066</guid><pubDate>Sun, 09 Mar 2014 15:21:00 +0000</pubDate><atom:updated>2015-03-15T16:14:04.873-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Assemblyinfo</category><category domain="http://www.blogger.com/atom/ns#">Class Library</category><category domain="http://www.blogger.com/atom/ns#">GAC</category><category domain="http://www.blogger.com/atom/ns#">shared Assembly</category><category domain="http://www.blogger.com/atom/ns#">Strong Name Key</category><title>Shared Assemblies</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/assembly.html&quot;&gt;Assembly&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/implementation-of-shared-assemblies.html&quot;&gt;Implementation of Shared Assemblies&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/shared-assemblies.html&quot;&gt;Shared Assemblies&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt; Shared Assembly &lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;

&lt;h1&gt;CREATE A CLASS LIBRARY PROJECT.&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;Open Visual Studio 2008.&lt;/li&gt;
&lt;li&gt;Click on ― &gt; File‖  ―&gt; New ―&gt; Project.&lt;/li&gt;
&lt;li&gt;Select the language as ―&gt; Visual C# and project template as ―&gt; Class Library.&lt;/li&gt;
&lt;li&gt;Enter the name as ―&gt; SharedAssemblyLibrary.&lt;/li&gt;
&lt;li&gt;Click  on  OK.  It  creates  a  new  class  library  project.  Initially  it  contains  a  new  class  called class1.&lt;/li&gt;
&lt;li&gt;In the solution explorer, rename the class1.cs  as &quot;MyLibraryClass.cs”.&lt;/li&gt;
&lt;li&gt;Then type the following code.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt; PROGRAM FOR CLASS LIBRARY PROJECT &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SharedAssemblyLibrary
{
  public class MyLibraryClass
 {
  public bool IsValidLogin(string Username, string Password)\
  {
   if (Username == &quot;system&quot; &amp;&amp; Password == &quot;manager&quot;)
   return true;
  else
   return false;
  }
 }
} 
&lt;/pre&gt;
&lt;div class=&quot;divh1&quot;&gt; CREATE A STRONG NAME KEY.&lt;/div&gt;
&lt;br/&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpixhk7eWMF3hUjdopBKpOrUFCsEiq4I1WfNnshJxIe44neDMo7mlYu1qhT3aI6Xm7CzBjoYKsbYqiV55BVwdCVqD40ywDRU7qwcEaQ2si3yFCucg5WJi0yJCkIB_UeocD4w-5ygxo-kk/s1600/Strong+Name.jpg&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpixhk7eWMF3hUjdopBKpOrUFCsEiq4I1WfNnshJxIe44neDMo7mlYu1qhT3aI6Xm7CzBjoYKsbYqiV55BVwdCVqD40ywDRU7qwcEaQ2si3yFCucg5WJi0yJCkIB_UeocD4w-5ygxo-kk/s200/Strong+Name.jpg&quot; width=&quot;250px&quot; height=&quot;200px&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Right  click  on  the  project  in  the  Solution  Explorer  and  choose  Properties.&lt;/li&gt;
&lt;li&gt;In  the  project  properties,  select  the check box Sign  the assembly&lt;/li&gt;
&lt;li&gt;In the Choose a strong name key file drop down, select &lt;New&gt; option.&lt;/li&gt;
&lt;li&gt;In the Create strong name key‖ dialog box, enter the name of the strong name key file as “MyKeyFile”. &lt;/li&gt;
&lt;li&gt;Uncheck the ―Protect my key file with a password‖ checkbox.&lt;/li&gt;
&lt;li&gt;Click on OK. &lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt;CUSTOMIZE THE “ASSEMBLY INFORMATION” (ASSEMBLYINFO.CS).&lt;/div&gt;
&lt;p&gt;Change the assembly version as “1.5.0.0”.&lt;/p&gt;
&lt;div class=&quot;divh1&quot;&gt;GENERATE THE DLL FILE.&lt;/div&gt;
&lt;p&gt;Build the class library project by clicking on ―Build‖ menu – ―Build Solution‖.&lt;/p&gt;
&lt;div class=&quot;divh1&quot;&gt;WRITE THE ASSEMBLY INTO GAC (GLOBAL ASSEMBLY CACHE).&lt;/div&gt;
&lt;ul&gt;&lt;li&gt;Open the following folder&lt;/li&gt;
&lt;li&gt;C:\Windows\Assembly&lt;/li&gt;
&lt;li&gt;Drag  and  drop  the  “SharedAssemblyLibrary.DLL‖  file  from  ―bin\Debug‖  folder  into the c:\windows\assembly folder.&lt;/li&gt;&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; INVOKE THE SHARED ASSEMBLY.&lt;/div&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEb9EkGfoVQUMqeOZo7cc1M2mZwQQcVwYXgWou3350inHH2jAOz3PnpidGXQbrPgPh1CKRwCbyTk7VGFF9yIxEgMVOYBFUGixxiQsChhPW_06W_KfAWsy6esBEVaOzCn3b_6_-F3kr0lo/s1600/Shared+Asseblies.jpg&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEb9EkGfoVQUMqeOZo7cc1M2mZwQQcVwYXgWou3350inHH2jAOz3PnpidGXQbrPgPh1CKRwCbyTk7VGFF9yIxEgMVOYBFUGixxiQsChhPW_06W_KfAWsy6esBEVaOzCn3b_6_-F3kr0lo/s200/Shared+Asseblies.jpg&quot; width=&quot;250px&quot; height=&quot;200px&quot;/&gt;&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;&lt;br/&gt;
&lt;ul valign=&quot;top&quot;&gt;
&lt;li&gt;Create a new Console Application. Name: SharedAssemblyDemo&lt;/li&gt;
&lt;li&gt;Click on Project  ―    Add Reference.&lt;/li&gt;
&lt;li&gt;Click on Browse tab&lt;/li&gt;
&lt;li&gt;From the class library project‘s  bin\Debug‖ folder, select the  “SharedAssemblyLibrary.dll  file and click on OK. Then the  .dll file reference will be added&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; PROGRAM FOR SHARED ASSEMBLIES   &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;                                                      
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharedAssemblyLibrary;
namespace SharedAssemblyDemo
{
class Program
 {
  static void Main(string[] args)
  {
   MyLibraryClass mlc = new MyLibraryClass();
   string Username, Password;
   Console.Write(&quot;Enter Username: &quot;);
   Username = Console.ReadLine();
   Console.Write(&quot;Enter Password: &quot;);
   Password = Console.ReadLine();
   bool result = mlc.IsValidLogin(Username, Password);
   if (result == true)
   Console.WriteLine(&quot;\nLogin successful!&quot;);
  else
   Console.WriteLine(&quot;\nInvalid Username / Password!&quot;);
   Console.Read();
  }
 }
}
&lt;/pre&gt;

&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/assembly.html&quot;&gt;Assembly&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/implementation-of-shared-assemblies.html&quot;&gt;Implementation of Shared Assemblies&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/shared-assemblies.html&quot;&gt;Shared Assemblies&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/shared-assemblies.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpixhk7eWMF3hUjdopBKpOrUFCsEiq4I1WfNnshJxIe44neDMo7mlYu1qhT3aI6Xm7CzBjoYKsbYqiV55BVwdCVqD40ywDRU7qwcEaQ2si3yFCucg5WJi0yJCkIB_UeocD4w-5ygxo-kk/s72-c/Strong+Name.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-8903306067483535309</guid><pubDate>Sun, 09 Mar 2014 14:31:00 +0000</pubDate><atom:updated>2015-03-15T16:33:35.865-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Multi Threading</category><category domain="http://www.blogger.com/atom/ns#">Multi-Tasking</category><category domain="http://www.blogger.com/atom/ns#">Program of Multi-Threading</category><category domain="http://www.blogger.com/atom/ns#">Thread</category><category domain="http://www.blogger.com/atom/ns#">Threading Architecture</category><title>Multi Threading &amp; Thread State</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/multi-threading-thread-state.html&quot;&gt;Multi Threading&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/thread-state.html&quot;&gt;Thread State&lt;/a&gt;&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt; Multi Threading &lt;/div&gt;&lt;br/&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Multi Threading is one of the rich features of .NET applications.&lt;/li&gt;
&lt;li&gt;Using this feature, the user is able to create multi-threaded applications.&lt;/li&gt;
&lt;li&gt;This concept is introduced in VC++. This is also supported by Java.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Definition  of Multi Threading:&lt;/b&gt;  The  ability  of  an  application  that  maintains  multiple threads at run time.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Definition of Thread:&lt;/b&gt; The thread is a sub process (part of the process). That means it has some code to execute.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Advantage  of  Multi-Threading:&lt;/b&gt; Using  multi  threading‖,  you  can  break  a  complex task  in  a  single  application  into  multiple  threads  that  execute  independently  and simultaneously.&lt;/li&gt;
&lt;li&gt;In other words, multi threading is the sub form of multi tasking.&lt;/li&gt;
&lt;li&gt;Before  starting  with  the  implementation  of  Multi  Threading,  you  should  recollect  the concept of Multi-Tasking.&lt;li&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; MULTI TASKING:&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Def:&lt;/b&gt; Ability  of  the  OS,  that  is  able  to  perform  more  than  one  task,  at-a-time (simultaneously) is called as Multi-Tasking.&lt;/li&gt;
&lt;li&gt;As a part of this, OS allocates the CPU clock (CPU capacity) for each task.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; Just like multi-tasking, OS allocates the CPU clock for each thread.&lt;/p&gt;
&lt;div class=&quot;divh1&quot;&gt; THREADING ARCHITECTURE &lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK6NDdklgjaBBz8MuE7Jn60oM8C9WFkJWwb8yVDbj2jOpABGVYM0X4j2LYvI0Su447-qCE1_1hh4RjY0fnpueBsVMQG3thKlBUqd1kJKhbrp2kzVAqIYbnp7y1mzLl5xjecRNkAkBzJ6o/s1600/Thread+Architectur.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK6NDdklgjaBBz8MuE7Jn60oM8C9WFkJWwb8yVDbj2jOpABGVYM0X4j2LYvI0Su447-qCE1_1hh4RjY0fnpueBsVMQG3thKlBUqd1kJKhbrp2kzVAqIYbnp7y1mzLl5xjecRNkAkBzJ6o/s1600/Thread+Architectur.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt; Implementation of Multi Threading:&lt;/div&gt;
&lt;p&gt;.NET Framework offers a namespace called “System.Threading” for implementation of multi threading.&lt;br/&gt;
&lt;/p&gt;
&lt;b&gt;Library:&lt;/b&gt;&lt;span style=&quot;color: red;&quot;&gt; System.Threading.Thread&lt;/span&gt;&lt;br/&gt;
This class object represents a thread.
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Import the API:&lt;/b&gt;&lt;/li&gt;
 &lt;span style=&quot;color: red;&quot;&gt;using System.Threading;&lt;/span&gt;
&lt;li&gt;&lt;b&gt;Create the Thread Object:&lt;/b&gt;&lt;/li&gt;
 &lt;span style=&quot;color: red;&quot;&gt;Thread th = new Thread(method name);&lt;/span&gt;
&lt;li&gt;Start the Thread:&lt;/li&gt;
 &lt;span style=&quot;color: red;&quot;&gt;th.Start()&lt;/span&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; Program for Multi-Threading &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace SimpleThreadingDemo
{
class ThreadingDemo
 {
  private void FirstMethod()
  {
   for (int i = 1; i &lt;= 300; i++)
   Console.Write(&quot;i=&quot; + i + &quot; &quot;);
  }
  private void SecondMethod()
  {
   for (int j = 1; j &lt;= 300; j++)
   Console.Write(&quot;j=&quot; + j + &quot; &quot;);
  }
  public void Display()
   {
    Thread th1 = new Thread(FirstMethod);
    Thread th2 = new Thread(SecondMethod);
    th1.Start();
    th2.Start(); 
   }
 }
 class Program
  {
   static void Main(string[] args)
   {
    ThreadingDemo td = new ThreadingDemo();
    td.Display();
    Console.Read();
   }
 }
} 
&lt;/pre&gt;
&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/multi-threading-thread-state.html&quot;&gt;Multi Threading&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/thread-state.html&quot;&gt;Thread State&lt;/a&gt;&lt;/div&gt;&lt;br/&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/multi-threading-thread-state.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK6NDdklgjaBBz8MuE7Jn60oM8C9WFkJWwb8yVDbj2jOpABGVYM0X4j2LYvI0Su447-qCE1_1hh4RjY0fnpueBsVMQG3thKlBUqd1kJKhbrp2kzVAqIYbnp7y1mzLl5xjecRNkAkBzJ6o/s72-c/Thread+Architectur.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-8314457926109793687</guid><pubDate>Sun, 09 Mar 2014 14:09:00 +0000</pubDate><atom:updated>2015-03-15T16:44:01.553-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Program of Thread class</category><category domain="http://www.blogger.com/atom/ns#">Thread</category><category domain="http://www.blogger.com/atom/ns#">Thread Class</category><title>Thread State</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/multi-threading-thread-state.html&quot;&gt;Multi Threading&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/thread-state.html&quot;&gt;Thread State&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt; Thread State&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;div&gt;
The &amp;nbsp;thread &amp;nbsp;state &amp;nbsp;specifies &amp;nbsp;the &amp;nbsp;current &amp;nbsp;status &amp;nbsp;of &amp;nbsp;the &amp;nbsp;thread. &amp;nbsp;Sometimes, &amp;nbsp;the &amp;nbsp;thread automatically &amp;nbsp;switches &amp;nbsp;from &amp;nbsp;one state &amp;nbsp;to &amp;nbsp;another &amp;nbsp;state &amp;nbsp;automatically; &amp;nbsp;at &amp;nbsp;some other &amp;nbsp;times, &amp;nbsp;you can switch its state by using the methods offered by Thread class.&lt;/div&gt;
&lt;div&gt;
The &amp;nbsp;following &amp;nbsp;diagram &amp;nbsp;called &amp;nbsp;Thread &amp;nbsp;Life &amp;nbsp;Cycle &amp;nbsp;describes &amp;nbsp;the &amp;nbsp;different &amp;nbsp;states &amp;nbsp;of &amp;nbsp;a thread.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj60GAV2HKuqcqWTNMLlShSONDSFVNH_YSW6Bajjx6w-IadtqagO8mKwZ7FHRAVdEHUxh2j-R8JAPB6OFlnOwZIF5jV7oeo472AZbHlLUZHy9poBCnX2PJYlw2D6UtMX03439w1TBvnm8g/s1600/Multi+Thread+Life+Cycle.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj60GAV2HKuqcqWTNMLlShSONDSFVNH_YSW6Bajjx6w-IadtqagO8mKwZ7FHRAVdEHUxh2j-R8JAPB6OFlnOwZIF5jV7oeo472AZbHlLUZHy9poBCnX2PJYlw2D6UtMX03439w1TBvnm8g/s1600/Multi+Thread+Life+Cycle.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Ready: &amp;nbsp;This is the initial state. The thread object is created.&lt;/li&gt;
&lt;li&gt;Running: The thread is currently being executed.&lt;/li&gt;
&lt;li&gt;Sleeping: The thread is temporarily paused. .NET framework offers automatic switching between Running and Sleeping states, when other threads are executed.&lt;/li&gt;
&lt;li&gt;Suspended: &amp;nbsp;The &amp;nbsp;thread is &amp;nbsp;temporarily &amp;nbsp;suspended &amp;nbsp;(paused). &amp;nbsp;It &amp;nbsp;will &amp;nbsp;be &amp;nbsp;continued, &amp;nbsp;when you call Resume() method.&lt;/li&gt;
&lt;li&gt;Dead: The thread was closed; it can‘t be restarted or continued.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt; Thread class methods:&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;thobj.Start() :&amp;nbsp;&lt;/span&gt;&lt;/b&gt;This method starts-up the thread execution.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Thread.Sleep(mille sec) :&lt;/span&gt;&amp;nbsp;&lt;/b&gt;This method puts the thread under Sleeping state, up to a certain no. of mille seconds. When &amp;nbsp;the &amp;nbsp;given &amp;nbsp;no. &amp;nbsp;of &amp;nbsp;mille &amp;nbsp;seconds are &amp;nbsp;completed, &amp;nbsp;automatically &amp;nbsp;the thread execution will be continued.&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: red;&quot;&gt;thobj.Suspend() : &lt;/b&gt;This &amp;nbsp;is &amp;nbsp;similar &amp;nbsp;to &amp;nbsp;Sleep() &amp;nbsp;method, &amp;nbsp;but &amp;nbsp;here, &amp;nbsp;no &amp;nbsp;time &amp;nbsp;limit &amp;nbsp;will &amp;nbsp;be &amp;nbsp;given. &amp;nbsp;That means whenever the Suspend() method is called, the thread will be put under Suspended state, until the Resume() method is called.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;thobj.Resume() : &lt;/span&gt;&amp;nbsp;&lt;/b&gt;This &amp;nbsp;is &amp;nbsp;to &amp;nbsp;continue &amp;nbsp;the &amp;nbsp;thread &amp;nbsp;execution &amp;nbsp;that &amp;nbsp;is &amp;nbsp;under &amp;nbsp;Suspended &amp;nbsp;state. &amp;nbsp;This method won‘t work if the thread is not under Suspended state.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;thobj.Abort() :&lt;/span&gt;&amp;nbsp;&lt;/b&gt;This is close the thread execution completely, at any time. Once, if the Abort() method is called, the thread can‘t be started or resumed. This is the end of every thread life cycle&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt; Program of Thread State &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;                                                                
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace ThreadLifeCycleDemo
{
class ThreadingDemo
{
 private void FirstMethod()
  {
   for (int i = 1; i &lt;= 50; i++)
   {
    Console.Write(&quot;i=&quot; + i + &quot; &quot;);
    Thread.Sleep(1000);
   }
  }
  private void SecondMethod()
  {
   for (int j = 1; j &lt;= 50; j++)
   {
    Console.Write(&quot;j=&quot; + j + &quot; &quot;);
    Thread.Sleep(1000);
    if (j == 20)
    th1.Suspend();
  else if (j == 30)
    th1.Resume();
   }
  }
  Thread th1, th2;
  public void Display()
   {
    th1 = new Thread(FirstMethod);
    th2 = new Thread(SecondMethod);
    th1.Start();
    th2.Start();
   }
  }
 class Program
 {
  static void Main(string[] args)
  {
   ThreadingDemo td = new ThreadingDemo();
   td.Display();
   Console.Read();
  }
 }
}
&lt;/pre&gt;

&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/multi-threading-thread-state.html&quot;&gt;Multi Threading&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/thread-state.html&quot;&gt;Thread State&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/thread-state.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj60GAV2HKuqcqWTNMLlShSONDSFVNH_YSW6Bajjx6w-IadtqagO8mKwZ7FHRAVdEHUxh2j-R8JAPB6OFlnOwZIF5jV7oeo472AZbHlLUZHy9poBCnX2PJYlw2D6UtMX03439w1TBvnm8g/s72-c/Multi+Thread+Life+Cycle.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-4071812022721450195</guid><pubDate>Sun, 09 Mar 2014 13:45:00 +0000</pubDate><atom:updated>2015-03-16T00:49:19.375-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Exception</category><category domain="http://www.blogger.com/atom/ns#">Exception Class</category><category domain="http://www.blogger.com/atom/ns#">Multi Catch Block</category><title>Exception Class</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/exception-handling-exception-class.html&quot;&gt;Exception Handling&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/exception-class.html&quot;&gt;Exception Class&lt;/a&gt;&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt; Exception Class&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Already you know that C# recognizes the exception as an object.&lt;/li&gt;
&lt;li&gt;To &amp;nbsp;declare &amp;nbsp;the &amp;nbsp;exception &amp;nbsp;object, &amp;nbsp;we &amp;nbsp;have &amp;nbsp;used &amp;nbsp;a &amp;nbsp;class &amp;nbsp;called &amp;nbsp;System.Exception, &amp;nbsp;in the previous examples.&lt;/li&gt;
&lt;li&gt;The Exception class recognizes any type of exceptions. In order to catch the particular type of error, C# provides other exceptional classes. Some of them are given here.&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;
&lt;table border=&quot;1&quot; bordercolor=&quot;#FFCC00&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #ffffcc; width: auto;&quot;&gt;

 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Exception Class&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot; style=&quot;height: auto; width: auto;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.OverflowException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  a  large  value  is assigned  to  a  variable,  which  is  not fit in that variable.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.FormatException / System.InvalidCastException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  the  casting  is  failed from  one  data  type  of  another  data type.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.DivideByZeroException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  any  number  is  divided by 0.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.IndexOutOfRangeException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs when an index is accessed in out of range.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.InsufficientMemoryException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  there  is  no  sufficient memory  in  RAM  for  the  execution  of the application.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.IO.FileNotFoundException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  a  non-existing  file  is accessed.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.IO.DirectoryNotFoundException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs when a non-existing directory is accessed.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.IO.FileLoadException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  any  error  occurred during the opening of any file.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.IO.IOException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  any  error  occurred during file read or writing.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.Threading.ThreadInterruptedException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  any  error  occurred during the execution of the thread.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.Threading.ThreadStartException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  any  error  occurred while starting the thread.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.InvalidOperationException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  any  error  occurred while  opening  the  database connection.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.Data.OleDb.OleDbException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  any  error  occurred while performing query or non-query transactions on OleDb databases.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.Data.SqlClient.SqlException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  any  error  occurred while performing query or non-query transactions on SqlServer database.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.EntryPointNotFoundException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  you  try  to  run  the application,  without  defining  any entry point (main() method).&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tdtext&quot;&gt;System.InvalidTimeZoneException&lt;/td&gt;
&lt;td class=&quot;tdtext&quot;&gt;Occurs  when  the  system  has  an invalid  time  zone  setting  the  date  &amp; time settings.&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt; PROGRAM OF EXCEPTION CLASS  &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ExceptionDemo3
{
class Program
{
static void Main(string[] args)
{
 try
 {
  int n1, n2, n3;
  Console.WriteLine(&quot;Enter first value:&quot;);
  n1 = Convert.ToInt32(Console.ReadLine());
  Console.WriteLine(&quot;Enter second value:&quot;);
  n2 = Convert.ToInt32(Console.ReadLine());
  n3 = n1 / n2;
  Console.WriteLine(&quot;Result is: &quot; + n3);
 }
 catch (DivideByZeroException ex)
  {
   Console.WriteLine(&quot;Can&#39;t divide the number with zero.&quot;);
  }
   Console.Read();
  }
 }
}
&lt;/pre&gt;

&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt;  If you want to handle more than one type of exception for the same try block, then you
need to write multiple catch blocks&lt;/p&gt;
&lt;div class=&quot;divh1&quot;&gt;PROGRAM FOR MULTIPLE CATCH BLOCK  &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ExceptionDemo4
{
class Program
{
static void Main(string[] args)
{
 try
 {
  int n1, n2, n3;
  Console.WriteLine(&quot;Enter first value:&quot;);
  n1 = Convert.ToInt32(Console.ReadLine());
  Console.WriteLine(&quot;Enter second value:&quot;);
  n2 = Convert.ToInt32(Console.ReadLine());
  n3 = n1 / n2;
  Console.WriteLine(&quot;Result is: &quot; + n3);
 }
 catch (DivideByZeroException ex)
 {
  Console.WriteLine(&quot;This is divide by zero exception.&quot;);
 }
 catch (OverflowException ex)
 {
  Console.WriteLine(&quot;This is overflow excpetion.&quot;);
 }
 catch (FormatException ex)
 {
  Console.WriteLine(&quot;This is invalid cast exception.&quot;);
 }
  Console.Read();
 }
 }
}
&lt;/pre&gt;

&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/exception-handling-exception-class.html&quot;&gt;Exception Handling&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/exception-class.html&quot;&gt;Exception Class&lt;/a&gt;&lt;/div&gt;&lt;br/&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/exception-class.html</link><author>noreply@blogger.com (fdfsdf)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-2835262185023350628</guid><pubDate>Sun, 09 Mar 2014 13:33:00 +0000</pubDate><atom:updated>2015-03-16T01:15:18.688-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Catch Statement</category><category domain="http://www.blogger.com/atom/ns#">Exception</category><category domain="http://www.blogger.com/atom/ns#">Exception Handling</category><category domain="http://www.blogger.com/atom/ns#">Finally Statement</category><category domain="http://www.blogger.com/atom/ns#">Program of Exception</category><category domain="http://www.blogger.com/atom/ns#">Program of Exception Handlign</category><category domain="http://www.blogger.com/atom/ns#">Try Satement</category><title>Exception Handling &amp; Exception Class</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;float: center;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/exception-handling-exception-class.html&quot;&gt;Exception Handling&lt;/a&gt;&amp;nbsp;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/exception-class.html&quot;&gt;Exception Class&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt; Exception Handling&lt;/div&gt;&lt;br/&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;ul&gt;
 &lt;li&gt;This  is  one of  the  major  features  of  OOP languages like  C++,  VC++,  VB.NET,  C#.NET, Java etc.&lt;/li&gt;
 &lt;li&gt;&lt;b&gt;Def: &lt;/b&gt; The  process  of  handling  the  run  time  exceptions&quot;  is  called  as  &quot;Exception handling&quot;.&lt;/li&gt;
&lt;p&gt;         Note: Exception =  Run time error&lt;/p&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; Types of Errors:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Compile Time Errors:&lt;/b&gt; &amp;nbsp;The &amp;nbsp;errors &amp;nbsp;occurred &amp;nbsp;after &amp;nbsp;compiling &amp;nbsp;the &amp;nbsp;program, &amp;nbsp;are &amp;nbsp;called &amp;nbsp;as compile time errors.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Run Time Errors:&lt;/b&gt; &amp;nbsp;The errors occurred during the execution &amp;nbsp;of the program, are called as run time errors.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;divh1&quot;&gt; Overview of Exception Handling:&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;The exception may occur at run time, based on the mistake of the user / programmer / system problem also.&lt;/li&gt;
&lt;li&gt;When exception is raised, automatically it leads to &quot;abnormal application termination&quot;.&lt;/li&gt;
&lt;li&gt;The &amp;nbsp;cause &amp;nbsp;of &amp;nbsp;the &amp;nbsp;exception &amp;nbsp;may &amp;nbsp;be &amp;nbsp;anything; &amp;nbsp;the &amp;nbsp;project &amp;nbsp;developer &amp;nbsp;should &amp;nbsp;take &amp;nbsp;care about the exceptions.&lt;/li&gt;
&lt;li&gt;As &amp;nbsp;a &amp;nbsp;part &amp;nbsp;of &amp;nbsp;this &amp;nbsp;exception &amp;nbsp;handling, &amp;nbsp;the &amp;nbsp;programmer &amp;nbsp;has &amp;nbsp;to &amp;nbsp;display &amp;nbsp;&quot;particular &amp;nbsp;error message&quot; to the user.&lt;/li&gt;
&lt;li&gt;Purpose of Exception &amp;nbsp;Handling: &amp;nbsp;To &amp;nbsp;avoid &amp;nbsp;&quot;abnormal &amp;nbsp;application &amp;nbsp;termination&quot;, &amp;nbsp;even though exception occurs.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; Types of Application Termination:&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: orange;&quot;&gt;Normal Application Termination:&lt;/span&gt; Whenever the program execution controls executes all the statements in the program and reaches to end of the code, the application will be terminated automatically. It can be called as Normal Application Termination.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;Abnormal &amp;nbsp;Application &amp;nbsp;Termination: &lt;/span&gt;&lt;/b&gt;&amp;nbsp;Whenever &amp;nbsp;an &amp;nbsp;exception &amp;nbsp;occurred &amp;nbsp;at &amp;nbsp;run &amp;nbsp;time, the application will be terminated automatically. It can be called as Abnormal Application Termination.If the application was terminated abnormally, if will be most inconvenience for the user. So being a programmer, you are responsible to avoid that kind of abnormal application termination, even though exception is occurred at run time&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; Program of Exception Demo &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ExceptionDemo1
{
class Program
 {
   static void Main(string[] args)
   {
    string[] Cities = { &quot;Vijayawada&quot;, &quot;New Delhi&quot;, &quot;Banglore&quot;, &quot;Hyderabad&quot; };
    Console.WriteLine(Cities[3]);
    Console.WriteLine(Cities[4]); &lt;!----Exception Raise-----&gt;        
     Console.Read();
   }
  }
}
&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp; &amp;nbsp; In the above code, the highlighted line contains an error, because it is trying to access an array &amp;nbsp;element &amp;nbsp;which &amp;nbsp;is &amp;nbsp;in &amp;nbsp;out &amp;nbsp;of &amp;nbsp;range &amp;nbsp;of &amp;nbsp;the &amp;nbsp;array. &amp;nbsp;So, &amp;nbsp;it &amp;nbsp;leads &amp;nbsp;to &amp;nbsp;abnormal &amp;nbsp;application termination at run time .&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghxlqF7mj1MUkateOOPJam-0hv3d4dh2UNqhSuALzenVC1z1780Uqe_28O1g2FQQjU_WybLK4Aw56w1Ys1VIsNKtX0B4YBP_LJz84-0T6iLTnEBn0MCaSKrhJ0WP42OhqJipMxeO9SB3c/s1600/exception+Handling.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;exception handling&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghxlqF7mj1MUkateOOPJam-0hv3d4dh2UNqhSuALzenVC1z1780Uqe_28O1g2FQQjU_WybLK4Aw56w1Ys1VIsNKtX0B4YBP_LJz84-0T6iLTnEBn0MCaSKrhJ0WP42OhqJipMxeO9SB3c/s1600/exception+Handling.jpg&quot; height=&quot;459&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
/*Syntax Of Exception
------------------------------*/
try
    {
       &lt;!--Code Here--&gt;
    }   

Catch (Exception ex)
    {
       &lt;!--Code Here--&gt;
    }

Finally
   {
       &lt;!--Code Here--&gt;
    }
&lt;/pre&gt;
&lt;div class=&quot;divh1&quot;&gt; try block:&lt;/div&gt;
&lt;div style=&quot;flaot:right;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0oHXbKljTLAJBppkJ3El2G3R34qiB3sAoDzXeYjFJcagTrpKAZ4S6SDVq59hnRt6WLEd6_qz65Hl3I-Iq5YYHhAoA8VJL-3_McgmJPhYmbEB2GkuUuu12fLW2ECU-TrB9CaonxXeEqWU/s1600/try.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0oHXbKljTLAJBppkJ3El2G3R34qiB3sAoDzXeYjFJcagTrpKAZ4S6SDVq59hnRt6WLEd6_qz65Hl3I-Iq5YYHhAoA8VJL-3_McgmJPhYmbEB2GkuUuu12fLW2ECU-TrB9CaonxXeEqWU/s1600/try.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;The try block contains the actual code, which is to be executed.&lt;/li&gt;
&lt;li&gt;After &amp;nbsp;every &amp;nbsp;try &amp;nbsp;block, &amp;nbsp;there &amp;nbsp;should &amp;nbsp;catch block without fail.&lt;/li&gt;
&lt;li&gt;The &amp;nbsp;system &amp;nbsp;tries &amp;nbsp;to &amp;nbsp;execute &amp;nbsp;the &amp;nbsp;code &amp;nbsp;in &amp;nbsp;the try block.&lt;/li&gt;
&lt;li&gt;During &amp;nbsp;the &amp;nbsp;execution, &amp;nbsp;if &amp;nbsp;any &amp;nbsp;exception occurs, then the execution control automatically goes to catch block.&lt;/li&gt;
&lt;li&gt;At the same time, the try block throws the exception to the catch block in the form of an object. That object is called as exception object.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; catch block:&lt;/div&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCF0mjcct2E2HhwnHmupH5S_B8N-2kMWc2mTrA__xRjMgVsLIq__Iqj1E0Ewnr3CJyQN6qgriC1fB84BjH5ZNtU0tHz9t4ONlNDjnLjtiXLk81HAMV-SKJOGSof2L6X81GlWJLWnT-OIc/s1600/catch+(exception+ex).jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCF0mjcct2E2HhwnHmupH5S_B8N-2kMWc2mTrA__xRjMgVsLIq__Iqj1E0Ewnr3CJyQN6qgriC1fB84BjH5ZNtU0tHz9t4ONlNDjnLjtiXLk81HAMV-SKJOGSof2L6X81GlWJLWnT-OIc/s1600/catch+(exception+ex).jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;This is also known as error handler.&lt;/li&gt;
&lt;li&gt;This is followed by the try block.&lt;/li&gt;
&lt;li&gt;The &amp;nbsp;catch &amp;nbsp;block &amp;nbsp;will &amp;nbsp;be &amp;nbsp;executed &amp;nbsp;if &amp;nbsp;any exception &amp;nbsp;is &amp;nbsp;occurred &amp;nbsp;during &amp;nbsp;the &amp;nbsp;execution of try block.&lt;/li&gt;
&lt;li&gt;The &amp;nbsp;catch &amp;nbsp;block &amp;nbsp;contains &amp;nbsp;necessary &amp;nbsp;code which &amp;nbsp;displays &amp;nbsp;an &amp;nbsp;error &amp;nbsp;message &amp;nbsp;to &amp;nbsp;the user.&lt;/li&gt;
&lt;li&gt;This receives the exception, thrown by the try block, in the form of an object. In the following syntax, ex is the Exception object. The Exception is the class for the exception object.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Library:&lt;/b&gt;&lt;span style=&quot;color: red;&quot;&gt; System.Exception&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; finally block:&lt;/div&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgb8JG0zR4t0Ead7osreYkHo9jRvEHTV70TF63UfK_BiXQZ3LSGUhXwcUo7Mgm4KYPqCmiWSXgsm4qW7DGJ3B33lHNcD-YhhNoSBge1qm2OYo4OJGBXvCavzHkiEC53lGPhlEjZ7x47aXQ/s1600/Finally.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgb8JG0zR4t0Ead7osreYkHo9jRvEHTV70TF63UfK_BiXQZ3LSGUhXwcUo7Mgm4KYPqCmiWSXgsm4qW7DGJ3B33lHNcD-YhhNoSBge1qm2OYo4OJGBXvCavzHkiEC53lGPhlEjZ7x47aXQ/s1600/Finally.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;This &amp;nbsp;block &amp;nbsp;will &amp;nbsp;be &amp;nbsp;executed &amp;nbsp;automatically &amp;nbsp;and compulsorily, &amp;nbsp;after &amp;nbsp;executing &amp;nbsp;try &amp;nbsp;block &amp;nbsp;/ &amp;nbsp;catch block.&lt;/li&gt;
&lt;li&gt;That &amp;nbsp;means &amp;nbsp;even &amp;nbsp;though &amp;nbsp;exception &amp;nbsp;is &amp;nbsp;raised &amp;nbsp;or not raised, the finally block will be executed without fail.&lt;/li&gt;
&lt;li&gt;This &amp;nbsp;is &amp;nbsp;optional &amp;nbsp;block. &amp;nbsp;You &amp;nbsp;can &amp;nbsp;write &amp;nbsp;the &amp;nbsp;exception &amp;nbsp;handling syntax &amp;nbsp;only &amp;nbsp;with try and catch blocks, without finally block.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; PROGRAM OF EXCEPTION HANDLIGN  &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;                                                      
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ExceptionDemo2
{
class Program
 {
  static void Main(string[] args)
  {
   try
    {
     string[] Cities = { &quot;Vijayawada&quot;, &quot;New Delhi&quot;, &quot;Banglore&quot;, &quot;Hyderabad&quot; };
     Console.WriteLine(Cities[3]);
     Console.WriteLine(Cities[4]);
    }
   catch (Exception ex)
    {
     Console.WriteLine(&quot;Error occurred.&quot;);
    }
   finally
    {
     Console.WriteLine(&quot;This is &#39;finally&#39; block.&quot;);
     Console.Read();
    }
  }
}
}
&lt;/pre&gt;
&lt;div class=&quot;divh1&quot;&gt; Types of Catch Block Messages:&lt;/div&gt;
&lt;p&gt;
Already we have discussed that the catch block generates an error message, when an exception occurs. That error message can be of two types.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;User Defined Message&lt;/li&gt;
&lt;li&gt;System Defined Message&lt;/li&gt;
&lt;/ol&gt;

&lt;ol&gt;
&lt;li&gt;&lt;b&gt;User Defined Message: &lt;/b&gt;Your own message can be written.
  &lt;ul&gt;&lt;li&gt; Error Occurred.&lt;/li&gt;
      &lt;li&gt; Operation is not successful. etc.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;System Defined Message:&lt;/b&gt; The  system  provides  the  description  of  the  error,  so  that you can  print that on the output directly. To access the system defined message, you can use the exception object as follows:
 &lt;ul&gt;&lt;li&gt;&lt;b&gt;Syn:&lt;/b&gt;&lt;span style=&quot;color: red;&quot;&gt;ex.Message&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAqChHGcHD1QC5bLHhjQHM49rgbNU-S4nbmFCf7aWZHcUX3Pu3Nx5r_teDJtH3kDb7Z8O1Ty42RCnrHhXIhcWaIMGQgZOZ0dEoWhDqsPbv_wqwbKjJdcvqbBgsutbWBXRh4zYVu_SYUBI/s1600/exception+Handling+2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAqChHGcHD1QC5bLHhjQHM49rgbNU-S4nbmFCf7aWZHcUX3Pu3Nx5r_teDJtH3kDb7Z8O1Ty42RCnrHhXIhcWaIMGQgZOZ0dEoWhDqsPbv_wqwbKjJdcvqbBgsutbWBXRh4zYVu_SYUBI/s1600/exception+Handling+2.jpg&quot; /&gt;&lt;/a&gt;&lt;b style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;float: center;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/exception-handling-exception-class.html&quot;&gt;Exception Handling&lt;/a&gt;&amp;nbsp;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/exception-class.html&quot;&gt;Exception Class&lt;/a&gt;
&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/exception-handling-exception-class.html</link><author>noreply@blogger.com (fdfsdf)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghxlqF7mj1MUkateOOPJam-0hv3d4dh2UNqhSuALzenVC1z1780Uqe_28O1g2FQQjU_WybLK4Aw56w1Ys1VIsNKtX0B4YBP_LJz84-0T6iLTnEBn0MCaSKrhJ0WP42OhqJipMxeO9SB3c/s72-c/exception+Handling.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-7492665121970966142</guid><pubDate>Sun, 09 Mar 2014 12:46:00 +0000</pubDate><atom:updated>2015-03-16T01:42:37.874-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Print</category><category domain="http://www.blogger.com/atom/ns#">Print Clas</category><category domain="http://www.blogger.com/atom/ns#">Print Document Class</category><category domain="http://www.blogger.com/atom/ns#">Program of Print Class</category><title>Print Document Class</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/collections.html&quot; style=&quot;text-decoration: underline;&quot;&gt;Collection&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/collection-initializer.html&quot; style=&quot;text-decoration: underline;&quot;&gt;Collection Initializer&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/print-document-class.html&quot;&gt;Printi Document Class&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt; Print Document Class&lt;/div&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;
.NET supports to print any type of documents through the printer.&lt;br/&gt;
&lt;b&gt;Library:&lt;/b&gt; &lt;span style=&quot;color: red;&quot;&gt;System.Drawing.Printing.PrintDocument&lt;/span&gt;&lt;br/&gt;
This class object represents a document (any type of file), that is ready to print.&lt;br/&gt;
&lt;b&gt;Note:&lt;/b&gt; &amp;nbsp;By default, System.Drawing assembly will not be linked with the Console applications.&amp;nbsp;&lt;br/&gt;
That‘s why you need to add a reference to that as follows:&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;Click on ―&amp;gt; Project menu &amp;nbsp;―&amp;gt; Add Reference.&lt;/li&gt;
&lt;li&gt;Select ―&amp;gt; System.Drawing assembly.&lt;/li&gt;
&lt;li&gt;Click &amp;nbsp;on &amp;nbsp;OK. &amp;nbsp;Then &amp;nbsp;the &amp;nbsp;System.Drawing &amp;nbsp;assembly &amp;nbsp;will &amp;nbsp;be &amp;nbsp;linked &amp;nbsp;with &amp;nbsp;the &amp;nbsp;current project and it will be displayed in References folder in the Solution Explorer.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; Implementation:&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Import the namespace:&lt;/b&gt;
 &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;using System.Drawing.Printing;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Construct the object:&lt;/b&gt;&lt;/li&gt;
 &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PrintDocument obj = new PrintDocument();&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Assign the document name, that is to be printed:&lt;/b&gt;&lt;/li&gt;
 &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;obj.DocumentName = file path to be printed;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Start Printing:&lt;/b&gt;&lt;/li&gt;
 &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;obj.Print();&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; PROGRAM FOR PRINT CLASS &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;                                                            
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing.Printing;
namespace PrintingDemo
{
 class Program
 {
  static void Main(string[] args)
  {
   PrintDocument doc = new PrintDocument();
   doc.DocumentName = &quot;c:\\SampleDocument.doc&quot;;
   doc.Print();
   Console.WriteLine(&quot;Printing started...&quot;);
   Console.Read(); 
  }
 }
}
&lt;/pre&gt;
&lt;div style=&quot;float: right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/collections.html&quot; style=&quot;text-decoration: underline;&quot;&gt;Collection&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/collection-initializer.html&quot; style=&quot;text-decoration: underline;&quot;&gt;Collection Initializer&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/print-document-class.html&quot;&gt;Printi Document Class&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/print-document-class.html</link><author>noreply@blogger.com (fdfsdf)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6427703763785525312.post-111836609593959123</guid><pubDate>Sun, 09 Mar 2014 12:44:00 +0000</pubDate><atom:updated>2015-03-16T01:53:43.016-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ArrayList</category><category domain="http://www.blogger.com/atom/ns#">Collection</category><category domain="http://www.blogger.com/atom/ns#">List Class</category><title>Collections</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/collections.html&quot;&gt;Collection&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/collection-initializer.html&quot;&gt;Collection Inititalizer&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/print-document-class.html&quot;&gt;Print Document Class&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div class=&quot;divh1&quot;&gt; Collection&lt;/div&gt;&lt;br/&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:468,&quot;height&quot;:180,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;The concept of collections is basically developed from Arrays.&lt;/li&gt;
&lt;li&gt;Already you know that, arrays are multiple value containers of fixed type.&lt;/li&gt;
&lt;li&gt;In order to hold different types of values on the same array, you require collections.&lt;/li&gt;
&lt;li&gt;Another advantage of collections is those are dynamic sizable. In other words, the array is of fixed size and the collection is of dynamic size.&lt;/li&gt;
&lt;li&gt;Finally, if you don‘t know how many values are to be stored in the array at the time of its declaration, &amp;nbsp;you &amp;nbsp;require &amp;nbsp;to &amp;nbsp;use &amp;nbsp;collections; &amp;nbsp;(or) &amp;nbsp;if &amp;nbsp;you &amp;nbsp;want &amp;nbsp;to &amp;nbsp;store &amp;nbsp;different &amp;nbsp;type &amp;nbsp;of values in the same array, at that case also, you require to use collections.&lt;/li&gt;
&lt;li&gt;.NET offers some pre-defined classes for maintenance of collections.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;divh1&quot;&gt; Collection Classes:&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;i&gt;List:&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Contains n no. of values of same type. It‘s a generic class.&lt;/li&gt;
&lt;li&gt;This is member of ―System.Collections.Generic” namespace.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;ArrayList:&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Contains n no. of values of different types.&lt;/li&gt;
&lt;li&gt;This is member of System.Collections namespace&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;divh1&quot;&gt; Implementation of “List” class:&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;b&gt;Import namespace:&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using System.Collections.Generic;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create instance:&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;List&amp;lt;data type&amp;gt; obj = new List&amp;lt;data type&amp;gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Add values:&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;obj.Add(value);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Get the currently existing no. of values in the collection:&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;obj.Count&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Get the individual element in the collection:&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt; Implementation of “ArrayList” class:&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Import namespace:&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using System.Collections;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create instance:&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ArrayList obj = new ArayList();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Add values:&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.Add(value);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Get the currently existing no. of values in the collection:&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj.Count&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Get the individual element in the collection:&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj[index];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;divh1&quot;&gt; Program of List Class &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System.Collections.Generic;
namespace ListClass
{
class Program
 {
  static void Main(string[] args)
  {
   List&lt;string&gt; MyMessages = new List&lt;string&gt;();
   MyMessages.Add(&quot;Good Morning&quot;);
   MyMessages.Add(&quot;Good Afternoon&quot;);
   MyMessages.Add(&quot;Good Evening&quot;);
   MyMessages.Add(&quot;Good Night&quot;);
 //MyMessages.Add(10); //error
   Console.WriteLine(MyMessages.Count + &quot; messages found.\n&quot;);
   foreach (string s in MyMessages)
   {
    Console.WriteLine(s);
   }
   Console.Read();
  }
 }
}
&lt;/pre&gt;
&lt;div class=&quot;divh1&quot;&gt;PROGRAM OF ARRAYLIST CLASS &lt;/div&gt;
&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace ArrayListClass
{
class Program
 {
  static void Main(string[] args)
  {
   ArrayList al = new ArrayList();
   al.Add(&quot;Hai&quot;);
   al.Add(&quot;How r u&quot;);
   al.Add(1000);
   al.Add(true);
   al.Add(DateTime.Now);
   Console.WriteLine(al.Count + &quot; values found.\n&quot;);
  for (int i = 0; i &lt; al.Count; i++)
   Console.WriteLine(al[i]);
   Console.Read();
  }
 }
}
&lt;/pre&gt;

&lt;div style=&quot;float:right;&quot;&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.in/2014/03/collections.html&quot;&gt;Collection&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/collection-initializer.html&quot;&gt;Collection Inititalizer&lt;/a&gt;
&lt;a href=&quot;http://microsoft-csharp-net.blogspot.com/2014/03/print-document-class.html&quot;&gt;Print Document Class&lt;/a&gt;
&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;script async=&quot;async&quot; type=&quot;text/javascript&quot;&gt;
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { &#39;units&#39; : [] }; };
    var unit = {&quot;calltype&quot;:&quot;async[2]&quot;,&quot;publisher&quot;:&quot;jayalaxmi0044&quot;,&quot;width&quot;:550,&quot;height&quot;:250,&quot;sid&quot;:&quot;Chitika Default&quot;,&quot;color_button&quot;:&quot;10404c&quot;,&quot;color_button_text&quot;:&quot;ffffff&quot;};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write(&#39;&lt;div id=&quot;chitikaAdBlock-&#39; + placement_id + &#39;&quot;&gt;&lt;/div&gt;&#39;);
}());
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;//cdn.chitika.net/getads.js&quot; async=&quot;async&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://microsoft-csharp-net.blogspot.com/2014/03/collections.html</link><author>noreply@blogger.com (fdfsdf)</author><thr:total>0</thr:total></item></channel></rss>