[英]How to Set DataGridView Image Cell Style to Stretch?
I want to stretch the images displayed in a DataGridView column:我想拉伸 DataGridView 列中显示的图像:
Trying to cast the last column as DataGridViewImageColumn
with尝试将最后一列转换为
DataGridViewImageColumn
((DataGridViewImageColumn)dataGridView1.Columns.GetLastColumn()).AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
Misses some DataGridViewStatesElements
arguments!错过了一些
DataGridViewStatesElements
参数!
Is there a better way to do this?有一个更好的方法吗?
I am pretty sure the AutoSizeMode
refers to the “column”… not the image in the column.我很确定
AutoSizeMode
指的是“列”……而不是列中的图像。 Try…尝试…
imgCol.ImageLayout = DataGridViewImageCellLayout.Stretch;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.