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

C#

 
QuestionHow to dynamically create a form in c# Pin
tonyjsebastian126-Nov-08 23:37
tonyjsebastian126-Nov-08 23:37 
AnswerRe: How to dynamically create a form in c# Pin
Kristian Sixhøj26-Nov-08 23:48
Kristian Sixhøj26-Nov-08 23:48 
AnswerRe: How to dynamically create a form in c# Pin
Sần Hải Quang27-Nov-08 0:13
Sần Hải Quang27-Nov-08 0:13 
GeneralRe: How to dynamically create a form in c# Pin
tonyjsebastian127-Nov-08 0:49
tonyjsebastian127-Nov-08 0:49 
GeneralRe: How to dynamically create a form in c# Pin
tonyjsebastian127-Nov-08 0:55
tonyjsebastian127-Nov-08 0:55 
GeneralRe: How to dynamically create a form in c# Pin
Sần Hải Quang27-Nov-08 1:23
Sần Hải Quang27-Nov-08 1:23 
GeneralRe: How to dynamically create a form in c# Pin
tonyjsebastian127-Nov-08 1:35
tonyjsebastian127-Nov-08 1:35 
GeneralRe: How to dynamically create a form in c# Pin
EliottA27-Nov-08 2:33
EliottA27-Nov-08 2:33 
public void CreateMyForm()
{
   // Create a new instance of the form.
   Form form1 = new Form();
   // Create two buttons to use as the accept and cancel buttons.
   Button button1 = new Button ();
   Button button2 = new Button ();
  
   // Set the text of button1 to "OK".
   button1.Text = "OK";
   // Set the position of the button on the form.
   button1.Location = new Point (10, 10);
   // Set the text of button2 to "Cancel".
   button2.Text = "Cancel";
   // Set the position of the button based on the location of button1.
   button2.Location
      = new Point (button1.Left, button1.Height + button1.Top + 10);
   // Set the caption bar text of the form.   
   form1.Text = "My Dialog Box";
   // Display a help button on the form.
   form1.HelpButton = true;

   // Define the border style of the form to a dialog box.
   form1.FormBorderStyle = FormBorderStyle.FixedDialog;
   // Set the MaximizeBox to false to remove the maximize box.
   form1.MaximizeBox = false;
   // Set the MinimizeBox to false to remove the minimize box.
   form1.MinimizeBox = false;
   // Set the accept button of the form to button1.
   form1.AcceptButton = button1;
   // Set the cancel button of the form to button2.
   form1.CancelButton = button2;
   // Set the start position of the form to the center of the screen.
   form1.StartPosition = FormStartPosition.CenterScreen;
   
   // Add button1 to the form.
   form1.Controls.Add(button1);
   // Add button2 to the form.
   form1.Controls.Add(button2);
   
   // Display the form as a modal dialog box.
   form1.ShowDialog();
}


http://msdn.microsoft.com/en-us/library/system.windows.forms.form.form(VS.71).aspx[^]
AnswerRe: How to dynamically create a form in c# Pin
jas0n2328-Nov-08 19:44
jas0n2328-Nov-08 19:44 
AnswerRe: How to dynamically create a form in c# Pin
nelsonpaixao30-Nov-08 4:53
nelsonpaixao30-Nov-08 4:53 
NewsEncode PHP file by Illuminations Tools Pin
Sần Hải Quang26-Nov-08 23:26
Sần Hải Quang26-Nov-08 23:26 
GeneralRe: Encode PHP file by Illuminations Tools Pin
Christian Graus26-Nov-08 23:34
protectorChristian Graus26-Nov-08 23:34 
GeneralRe: Encode PHP file by Illuminations Tools Pin
Sần Hải Quang27-Nov-08 0:06
Sần Hải Quang27-Nov-08 0:06 
GeneralRe: Encode PHP file by Illuminations Tools Pin
leppie27-Nov-08 0:50
leppie27-Nov-08 0:50 
QuestionP/Invoke Exceptions Pin
HosamAly26-Nov-08 23:13
HosamAly26-Nov-08 23:13 
AnswerRe: P/Invoke Exceptions Pin
Christian Graus26-Nov-08 23:15
protectorChristian Graus26-Nov-08 23:15 
AnswerRe: P/Invoke Exceptions Pin
Mark Salsbery28-Nov-08 13:28
Mark Salsbery28-Nov-08 13:28 
GeneralRe: P/Invoke Exceptions Pin
HosamAly28-Nov-08 20:57
HosamAly28-Nov-08 20:57 
Questioncalling another compiler from c# Pin
tonyjsebastian126-Nov-08 23:09
tonyjsebastian126-Nov-08 23:09 
AnswerRe: calling another compiler from c# Pin
Christian Graus26-Nov-08 23:10
protectorChristian Graus26-Nov-08 23:10 
QuestionGetActiveObject doesn't work when run from ASP. Pin
Zyraph26-Nov-08 23:07
Zyraph26-Nov-08 23:07 
AnswerRe: GetActiveObject doesn't work when run from ASP. Pin
Christian Graus26-Nov-08 23:09
protectorChristian Graus26-Nov-08 23:09 
GeneralRe: GetActiveObject doesn't work when run from ASP. Pin
Zyraph27-Nov-08 14:16
Zyraph27-Nov-08 14:16 
Question.net remoting Pin
krinaljariwala26-Nov-08 22:46
krinaljariwala26-Nov-08 22:46 
AnswerRe: .net remoting Pin
tonyjsebastian126-Nov-08 23:03
tonyjsebastian126-Nov-08 23:03 

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.