簡體   English   中英

表單圖標保存在WinForms應用程序中的哪里?

[英]Where is the form icon saved in a WinForms application?

我不知道表單的圖標保存在哪里...

我實際上在項目資源中搜索它,但沒有找到它,也沒有在窗體的“屬性”中指定指向它的任何路徑,它仍然出現在窗體上。

是序列化的地方嗎? 我只是想找到它並對其進行修改,並確保新添加的圖標將保留在那里...

僅從表單的表單屬性中設置一個新圖標就足夠了,並且該圖標會自動保存在舊圖標的位置中嗎?

更具體地說,我還添加了一張帶有示例的圖片,該示例帶有我正在談論的表單圖標。

在此處輸入圖片說明

在設計器中打開您的表單。 打開屬性框。 單擊表格以選擇它。 在“窗口樣式”組的“屬性”框中查找“圖標”元素。

如果通過“屬性”框更改圖標,然后查看設計器代碼,則會看到以下內容(Form1.Designer.cs):

        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(1008, 540);
        this.Controls.Add(this.btnTestReplacePerformance);
        this.Controls.Add(this.label3);
        this.Controls.Add(this.txtResults);
        this.Controls.Add(this.btnGetMatches);
        this.Controls.Add(this.txtSource);
        this.Controls.Add(this.txtRegex);
        this.Controls.Add(this.label2);
        this.Controls.Add(this.label1);
        this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
        this.Name = "Form1";
        this.Text = "Form1";
        this.ResumeLayout(false);
        this.PerformLayout();

您會看到圖標(this.Icon)是從資源中加載的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM