Control.CompanyName 屬性

定義

取得包含控制項之應用程式的公司名稱或建立者。

public:
 property System::String ^ CompanyName { System::String ^ get(); };
[System.ComponentModel.Browsable(false)]
public string CompanyName { get; }
[<System.ComponentModel.Browsable(false)>]
member this.CompanyName : string
Public ReadOnly Property CompanyName As String

屬性值

String

包含控制項之應用程式的公司名稱或建立者。

屬性

範例

下列程式碼範例會顯示 包含在 中 Label Form 之 應用程式的相關資訊。 此範例需要 CompanyName 已設定 和 ProductName ProductVersion

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 );
}
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;  
}
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

備註

屬性 CompanyName 是唯讀屬性。 若要變更這個屬性的值,請設定 CompanyAssemblyCompanyAttribute 屬性值。 下列 C# 程式程式碼會設定 CompanyName 屬性。

[assembly: AssemblyCompany("Microsoft")]  

注意

強烈建議您為您的應用程式提供公司名稱、產品名稱和產品版本。

適用於

另請參閱