Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Control.CompanyName Property

Gets the name of the company or creator of the application containing the control.

[Visual Basic]
Public ReadOnly Property CompanyName As String
[C#]
public string CompanyName {get;}
[C++]
public: __property String* get_CompanyName();
[JScript]
public function get CompanyName() : String;

Property Value

The company name or creator of the application containing the control.

Remarks

The CompanyName property is a read-only property. In order to change the value of this property, set the Company property value of the AssemblyCompanyAttribute. The following line of C# code sets the CompanyName property.

[C#] 
[assembly: AssemblyCompany("Microsoft")]
Note   It is strongly recommended that you provide the company name, product name, and product version. Providing this information enables the use of Windows Forms features such as Application.UserAppDataPath that make it easier to write applications that comply with the "Certified for Windows" program. For more information on the Certified for Windows program, see http://msdn.microsoft.com/certification.

Example

[Visual Basic, C#, C++] The following example displays information about the application in a Label contained by a Form. This code assumes the CompanyName, ProductName and ProductVersion have been set.

[Visual Basic] 
Private Sub AboutDialog_Load(sender As Object, e As EventArgs) Handles MyBase.Load
   ' Display the application information in the label.
   Me.labelVersionInfo.Text = _
      Me.CompanyName + "  " + _
      Me.ProductName + "  Version: " + _
      Me.ProductVersion
   End Sub

[C#] 
private void AboutDialog_Load(object sender, EventArgs e)
{
   // Display the application information in the label.
   this.labelVersionInfo.Text = 
      this.CompanyName + "  " + 
      this.ProductName + "  Version: " +
      this.ProductVersion;  
}

[C++] 
void AboutDialog_Load(Object* /*sender*/, EventArgs* /*e*/) {
   // Display the application information in the label.
   this->labelVersionInfo->Text =
      String::Format( "{0} {1} Version: {2}", this->CompanyName, this->ProductName, this->ProductVersion );
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Control Class | Control Members | System.Windows.Forms Namespace | AssemblyCompanyAttribute.Company | FileVersionInfo.CompanyName

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.