Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>Did the project compiled without any errors ?</code>. </p> <p>By default every Event Handler in C# is declared as void,which I am unable to find in your code.Did you modify the Event Handlers generated by Visual Studio,if this is the case then the issue you are facing is because of this.</p> <p>Let me explain what would have gone wrong;</p> <p>Whenever you create a Event Handler for any control using the Properties Window of Visual Studio,for the sake of this explanation let me take <code>example of TextBox</code>.Suppose you have a TextBox (named as textBox1,which is default) and you subscribe to its <code>TextChanged Event</code> (to do that locate TextChanged event in the events window of Visual Studio and double click it,when you do that Visual Studio generates this for you;</p> <pre><code>private void textBox1_TextChanged(object sender,EventArgs e) { } </code></pre> <p>This is what we programmers call an <code>Event Handler</code>,now locate <code>Solution Explorer Window in Visual Studio</code> click on <code>Form1.Designer.cs</code> you will get a lot of code there,locate the line which says </p> <p><code>private System.Windows.Forms.TextBox textBox1;</code></p> <p>where textBox1 is the control's name.Locate a plus sign above this point,click it and locate the following code;</p> <pre><code>// // textBox1 // this.textBox1.AcceptsReturn = true; this.textBox1.Location = new System.Drawing.Point(478, 0); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(359, 23); this.textBox1.TabIndex = 1; this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); </code></pre> <p><code>PS:The Location , AcceptsReturn , Size and TabIndex property in yours might not be same as mine.</code></p> <p>Read the last line of this code,it says;</p> <pre><code>this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); </code></pre> <p>where <code>textBox1_TextChanged is the name of event which must be same as that defined in Form1.cs.</code>If you modify this you'll get various compile time errors.</p> <p>So now I guess you know what is the relationship between <code>Form1.cs</code>(main code file) and <code>Form1.Designer.cs</code>(code behind file).</p> <p>In one line the conclusion is that make sure ;</p> <p><code>Any event handler function in Form1.cs</code> starts with <strong>private void ....</strong>,and the words after private void are exactly same as defined in the code behind file for that particular control.If you would like to read more about this stuff,have a look <a href="http://www.codeproject.com/Articles/5043/Step-by-Step-Event-handling-in-C" rel="nofollow">here</a>.</p> <p>Hope it would have helped you to solve the issue.Anything else left please inform me.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload