我有一個包含的圖像和文本的按鈕:調整圖像大小時調整
當我調整我的申請,我調整標籤以適應新的按鈕的高度,但圖像不調整:
我看到了一個解決辦法是圖像設置爲BackgroundImage
但它不符合我的按鈕設計:
this.buttonClose.Dock = System.Windows.Forms.DockStyle.Fill;
this.buttonClose.Image = ((System.Drawing.Image)(resources.GetObject("buttonClose.Image")));
this.buttonClose.Name = "buttonClose";
this.buttonClose.Size = new System.Drawing.Size(482, 28);
this.buttonClose.Text = "Close";
this.buttonClose.TextAlign = ContentAlignment.MiddleRight;
this.buttonClose.TextImageRelation = TextImageRelation.ImageBeforeText;
this.buttonClose.UseVisualStyleBackColor = true;
this.buttonClose.Click += new System.EventHandler(this.buttonClose_Click);
[製作背景圖像規模與按鈕的大小(HTTPS的可能重複:// stackoverflow.com/questions/13357032/making-a-background-image-scale-with-button-size) – fuchs777
@ fuchs777正如我所說,我不想使用'BackgroundImage'來同時顯示文字和圖片 –
_I don不想使用BackgroundImage同時具有文本和圖像_但是您__可以同時擁有BackgrondImage和!加上Stretch和Zoom的BackgroundImageLayout選項! – TaW