我已向 DataGridView 添加了一个按钮列,并希望在其上显示文本“比较”。我已经设置了Text
比较和属性UseColumnTextForButtonValue
为 True,但不显示任何文本:
这在运行时也是如此,所以它不仅仅是不显示在设计器中:
如何让文字显示出来?
编辑:为了繁荣起见,这里是生成的 Designer.cs 文件中的代码。我还没有添加any我自己还没有编写过这种形式的代码,所以不可能有什么东西会进一步重置它。
//
// Compare
//
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Compare.DefaultCellStyle = dataGridViewCellStyle1;
this.Compare.HeaderText = "Compare";
this.Compare.Name = "Compare";
this.Compare.Text = "Compare";
this.Compare.ToolTipText = "Compare the dictionary definition to the system definition";
this.Compare.UseColumnTextForButtonValue = true;
DataGridViewButtonColumn 不显示最后一行按钮中的文本。由于在您的示例中仅显示一行,因此未显示。添加更多行,文本将出现在除最后一行之外的所有行中。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)