Form Class Members

CodeKeep C# Feed Giugno 17th, 2008

Description: Documented Memebrs of FORM

Link: http://www.codekeep.net/snippets/7f2acf17-0777-450c-a021-d64b5e5a5bf1.aspx

// Add pre-defined Controls to the form.
this.Controls.Add(button1);
// Add button2 to the form.
this.Controls.Add(button2);
// Add Form to a pre-defined panel.
panel1.Controls.Add(this);

//FormBorderStyle  Gets or sets the border style of the form.
//
//Define the border style of the form to a FixedToolWindow
this.FormBorderStyle = FormBorderStyle.FixedToolWindow;
//
// Define the border style of the form to a dialog box.
this.FormBorderStyle = FormBorderStyle.FixedDialog;

//FormStartPosition   Gets or sets the starting position of the form at run time.
//
// Set the start position of the form to the center of the screen.
form1.StartPosition = FormStartPosition.CenterScreen;

//MaximizeBox   Gets or sets a value indicating whether the Maximize button is displayed in the caption bar of the form.
//MinimizeBox	Gets or sets a value indicating whether the Minimize button is displayed in the caption bar of the form.
//
// 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;

//Referencing Form Class by passing this on instantiation of class
//
//Field variable
public Form2 MyToolWindow;
//
MyToolWindow = new Form2(this, panel1);
//
//Note: Class being called has receiving arguments as below in class constructor
public Form2(Form referencingForm, Panel referencingPanel)

//Show or ShowDialog means to display
//
// Display the form as a modal dialog box.
form1.ShowDialog();

//ShowInTaskbar using boolean
//Gets or sets a value indicating whether the form is displayed in the Windows taskbar.
this.ShowInTaskbar = false;

//Text for title in form (leave propeties Text blank)
//Gets or sets the text associated with this control. (Overrides Control..::.Text.)
//In .NET Compact Framework 3.5, this member is inherited from Control..::.Text.
this.Text = "TitleBar name here...";

//TopLevel   Gets or sets a value indicating whether to display the form as a top-level window.
this.TopLevel = false;
 

  • .NET
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Comments are closed.

Trackback URI |