为什么像 Button
或 PictureBox
这样的控件同时具有 BackgroundImage
和 Image
属性?
为什么在按钮的情况下它们都需要? 或者为什么在 picturebox backgroundimage 中应该可用?
最佳答案
BackgroundImage
继承自 Control
。
Image
,在 Button
的情况下继承自 ButtonBase
。
一般来说,BackgroundImage
是:
An Image that represents the image to display in the background of the control.
Image
将是 控件上的那个。
为什么需要这两个?
- 因为控件周围可能有边距,您希望在控件上显示背景图像。
- 因为有时您可能会在
Image
上使用透明胶片并希望背景图像显示出来。
关于.net - 为什么有些控件同时具有 BackgroundImage 和 Image 属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4634904/