[問題] BackgroundImageLayout 的問題

看板C_Sharp (C#)作者 (羅伯陳)時間6年前 (2018/12/30 22:32), 6年前編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
我想用 picturebox 的 BackgroundImageLayout 可是我發現有個問題 我不能用程式去設定 BackgroundImageLayout 當我設定 this.BackgroundImageLayout = ImageLayout.Zoom; 也是跑原來大小的圖片 debug 之後確實有改Zoom 請問該怎樣改寫? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.135.6.189 ※ 文章網址: https://www.ptt.cc/bbs/C_Sharp/M.1546180377.A.8F4.html 補充 class cPicture : PictureBox { public cPicture() { this.Image = Properties.Resources.犬走椛; this.BackColor = Color.Transparent; //輸入MSDN this.Location = new Point(420, 316); this.Size = new Size(176, 269); this.BackgroundImageLayout = ImageLayout.Zoom; } } 主要程式是這樣,我用 cPicture 去繼承 PictureBox,這物件有這功能。 當主程式去呼叫這物件時,圖片都會印出來。 問題是其他功能有效果,唯獨this.BackgroundImageLayout = ImageLayout.Zoom;無效 ※ 編輯: ChenRobert (220.135.6.189), 12/31/2018 09:43:15
文章代碼(AID): #1SADSPZq (C_Sharp)
文章代碼(AID): #1SADSPZq (C_Sharp)