Control.CompanyName Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan nama perusahaan atau pembuat aplikasi yang berisi kontrol.
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
Nilai Properti
Nama perusahaan atau pembuat aplikasi yang berisi kontrol.
- Atribut
Contoh
Contoh kode berikut menampilkan informasi tentang aplikasi dalam yang Label terkandung oleh Form. Contoh ini mengharuskan CompanyName, ProductName dan ProductVersion telah ditetapkan.
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
Keterangan
Properti CompanyName adalah properti baca-saja. Untuk mengubah nilai properti ini, atur Company nilai properti dari AssemblyCompanyAttribute. Baris kode C# berikut mengatur CompanyName properti .
[assembly: AssemblyCompany("Microsoft")]
Nota
Sangat disarankan agar Anda memberikan nama perusahaan, nama produk, dan versi produk untuk aplikasi Anda.