Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
AnswerRe: How could i develop a running-once application Pin
mav.northwind7-Sep-04 20:37
mav.northwind7-Sep-04 20:37 
AnswerRe: How could i develop a running-once application Pin
Dave Kreskowiak8-Sep-04 7:25
mveDave Kreskowiak8-Sep-04 7:25 
AnswerRe: How could i develop a running-once application Pin
Nick Parker8-Sep-04 9:57
protectorNick Parker8-Sep-04 9:57 
GeneralDrag and Drop Pin
eggie57-Sep-04 17:32
eggie57-Sep-04 17:32 
GeneralRe: Drag and Drop Pin
Corinna John7-Sep-04 19:53
Corinna John7-Sep-04 19:53 
GeneralRe: Drag and Drop Pin
eggie58-Sep-04 2:10
eggie58-Sep-04 2:10 
GeneralCustom Schedule Control Pin
Beringer7-Sep-04 15:57
Beringer7-Sep-04 15:57 
GeneralControl Pin
ImanMahmoud7-Sep-04 15:26
ImanMahmoud7-Sep-04 15:26 
i want, form another form, and at a specified condition, to create an object from a certain control and add it to the first form, like :
namespace Win
{
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button button1  = new Button();
		private System.Windows.Forms.Button button2  = new Button();
		public System.Windows.Forms.Panel panel1;

		public Form1()
		{
			InitializeComponent();
		}

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

		private void button1_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void button2_Click(object sender, System.EventArgs e)
		{
			Form2 f2 = new Form2();
			f2.Show();
		}
	}// Form1

	public class Form2 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button button1 = new Button() ;

		public Form2()
		{
			InitializeComponent();
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			// at a specified condition :

			Button b = new Button();
			b.Text = "Hello" ;
			Form1 f1 = new Form1();
			f1.panel1.Controls.Add(b);
		}

	}// Form2
}// namespace Win

this code does not work. What is the wrong here ?

thanks
GeneralRe: Control Pin
Charlie Williams7-Sep-04 15:53
Charlie Williams7-Sep-04 15:53 
GeneralRe: Control Pin
WillemM7-Sep-04 20:07
WillemM7-Sep-04 20:07 
GeneralFile association (open) Pin
Arun Bhalla7-Sep-04 14:29
Arun Bhalla7-Sep-04 14:29 
GeneralRe: File association (open) Pin
Sebastian Schneider8-Sep-04 2:07
Sebastian Schneider8-Sep-04 2:07 
GeneralCustom Control stacking (z-order) problem Pin
dotbomb7-Sep-04 11:59
dotbomb7-Sep-04 11:59 
GeneralRe: Custom Control stacking (z-order) problem Pin
leppie7-Sep-04 21:04
leppie7-Sep-04 21:04 
GeneralRe: Custom Control stacking (z-order) problem Pin
dotbomb11-Sep-04 16:43
dotbomb11-Sep-04 16:43 
GeneralRe: Custom Control stacking (z-order) problem Pin
dotbomb12-Sep-04 8:02
dotbomb12-Sep-04 8:02 
QuestionHow to use InternetQueryOption from WinInet in C# Pin
JavaWriter20047-Sep-04 10:09
JavaWriter20047-Sep-04 10:09 
AnswerRe: How to use InternetQueryOption from WinInet in C# Pin
David Salter7-Sep-04 11:16
David Salter7-Sep-04 11:16 
GeneralRe: How to use InternetQueryOption from WinInet in C# Pin
Anonymous7-Sep-04 11:48
Anonymous7-Sep-04 11:48 
General2d graphics with Direct3D 9 Pin
arik_a7-Sep-04 8:39
arik_a7-Sep-04 8:39 
GeneralRe: 2d graphics with Direct3D 9 Pin
Christian Graus7-Sep-04 12:13
protectorChristian Graus7-Sep-04 12:13 
GeneralRe: 2d graphics with Direct3D 9 Pin
arik_a7-Sep-04 13:09
arik_a7-Sep-04 13:09 
GeneralRe: 2d graphics with Direct3D 9 Pin
Christian Graus7-Sep-04 13:25
protectorChristian Graus7-Sep-04 13:25 
GeneralRe: 2d graphics with Direct3D 9 Pin
arik_a7-Sep-04 13:42
arik_a7-Sep-04 13:42 
GeneralRe: 2d graphics with Direct3D 9 Pin
Christian Graus7-Sep-04 14:29
protectorChristian Graus7-Sep-04 14:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.