ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Code Snippets  >>  Programming Code  >>  Dot Net Code  >>  C Sharp Code
 
 


 

 
 ASP.NET Code interview questions  ASP.NET Code Interview Questions
 VB.NET Code interview questions  VB.NET Code Interview Questions
 C Sharp Code interview questions  C Sharp Code Interview Questions
 ADO.NET Code interview questions  ADO.NET Code Interview Questions
Question
Event Handling in C# Triggering a Button
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Event Handling in C# Triggering a Button
Answer
# 1
using System;
using System.Windows.Forms;
using System.Drawing;

public class Butevent:Form  {
TextBox t1 = new TextBox();
Button b1 = new Button();
public Butevent() {
this.Text = "C# Program ";
t1.Location = new Point(20,30);
b1.Text = "Click here to activate";
b1.Location = new Point(20,55);
b1.Size = new Size(150,20);

     // Invoking Method or EventHandler
     b1.Click+=new EventHandler(OnClick);

     this.Controls.Add(t1);
     this.Controls.Add(b1);

     // Invoking Method or EventHandler
     this.Resize += new EventHandler(OnResize);
   }

   //Applying EventHandler
   public void OnResize(object sender,EventArgs ee) {
      MessageBox.Show("oops! Form Resized");
   }

   //Applying EventHandler
   public void OnClick(object sender,EventArgs e) {
      t1.Text = "Hello C#";
   }

   public static void Main() {
      Application.Run(new Butevent());
   }

}
 
Is This Answer Correct ?    0 Yes 0 No
Guest
 

 
 
 
Other C Sharp Code Interview Questions
 
  Question Asked @ Answers
 
How to Create a Treeview Menu in ASP.NET with C#?  1
Event Handling in C# Triggering a Button  1
Automatically Hyperlink URLs and E-Mail Addresses in ASP.NET Pages with C#  1
"c sharp" code for factorial using static variables  4
Code for Working with Files under a Directory?  1
How to use ASP.NET 2.0's TreeView to Display Hierarchical Data?  1
 
For more C Sharp Code Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com