返回首页

每一个身体......
我想要写从DataGridView继承控制自定义headerCell。
它是如何使用一个自定义控件(用户控制或继承的控制)成DataGridViewColumnHeaderCell类?共同控制是容易通过,例如复选框:CheckBoxRenderer.DrawCheckBox(...);我只是想知道它是如何与用户控制或继承的可能
感谢..

这是假设是我定制headerCell的:??
LT;前LANG = "C#"GT;
公共类DataGridViewComboBoxHeaderCell:DataGridViewColumnHeaderCell
{
NBSP

NBSP公共DataGridViewComboBoxHeaderCell()
{
NBSP
}
NBSP UnitConvertorComboBox.UnitConvertorComboBox组合UnitConvertorComboBox.UnitConvertorComboBox()

保护覆盖无效油漆(的System.Drawing.Graphics图形,
System.Drawing.Rectangle clipBounds,
NBSP ; System.Drawing.Rectangle cellBounds,
NBSP NBSP 诠释rowIndex,
NBSP DataGridViewElementStates dataGridViewElementState,
NBSP NBSP对象的值,
NBSP FormattedValue的对象,
NBSP ; 的字符串ERRORTEXT,
NBSP ,
NBSP的DataGridViewCellStyle cellStyle; NBSP DataGridViewAdvancedBorderStyle advancedBorderStyle,
NBSP ; NBSP DataGridViewPaintParts paintParts)
{
NBSP NBSP base.Paint(图形,clipBounds,cellBounds,rowIndex,
dataGridViewElementState,价值,
FormattedValue的ERRORTEXT,cellStyle,
NBSP advancedBorderStyle,paintParts)
}
}
LT ;/ pregt;
这是我从ComboBox中继承的自定义控件:{ BR} LT;前郎="ç#"GT;
公共部分类UnitConvertorComboBox:ComboBox中
{
/ /构造
的公共UnitConvertorComboBox()
{{BR } NBSP }
NBSP
LT ;/ pregt;

回答

评论会员: 时间:2
a