Control.ProductName プロパティ

定義

コントロールを格納しているアセンブリの製品名を取得します。

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

プロパティ値

コントロールを格納しているアセンブリの製品名。

属性

次のコード例では、 に含まれる 内のアプリケーションに Label 関する情報を Form表示します。 この例では、 と ProductVersionProductNameCompanyName設定されている必要があります。

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

注釈

ProductName プロパティは、読み取り専用のプロパティです。 このプロパティの値を変更するには、 のプロパティ値を Product 設定します AssemblyProductAttribute。 次の C# コード行は、 プロパティを設定します ProductName

[assembly: AssemblyProduct("MyApplication")]

注意

会社名、製品名、製品バージョンを指定することを強くお勧めします。 この情報を提供すると、 などのApplication.UserAppDataPathWindows フォーム機能を使用して、"Certified for Windows" プログラムに準拠するアプリケーションを簡単に作成できます。

適用対象

こちらもご覧ください