C# Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 2413 Page Views: 

How do you add button to form using c# code?



Posted By: Avi Date: 15 October 2010 10:27:47 AM
 Answer:

Button btn = new Button(); //set button properties Form.Controls.Add(btn);


Posted By: avibtech


Date: 15 October 2010 10:27:47 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image wGYqNU
Related Questions
C# : Write a code in c# to run the program at particular time?

Write a code in c# to run the program at particular time?

public static void Main() { Timer t = new Timer(); t.Elapsed += new ElapsedEventHandler(OnElapsedTim....
Category: C# Date: 10/1/2010 11:48:31 AM
C# : Who developed C# and when?

Who developed C# and when?

C# was developed in 2000 is known as Microsoft's flagship language. It was developed by Microsoft wi....
Category: C# Date: 10/1/2010 11:47:31 AM
C# : Give some difference between C# and C++?

Give some difference between C# and C++?

1. C++ code usually compiles to assembly language whereas C# compiles to Intermediate language . 2. ....
Category: C# Date: 10/1/2010 11:46:31 AM
C# : Why a compiler adds a default constructor to a class?

Why a compiler adds a default constructor to a class?

Whenever the constructor is not defined by the programmer the compiler will automatically add a cons....
Category: C# Date: 10/1/2010 11:45:31 AM
C# : Catch Blocks are used to handle exceptions or errors. But what to do when an error occurs in the catch block?

Catch Blocks are used to handle exceptions or errors. But what to do when an error occurs in the cat....

To prevent or avoid errors in the catch block one can include a try and catch block in the catch blo....
Category: C# Date: 10/1/2010 11:44:31 AM