0

I am working on the datagridview now days. And I have to assign some custom properties to the datagridview which I am able to do. problem comes when I want to extend the properties of the cell. for example I already have my custom textbox control which user can set the behaviour like if its numeric or alphanumeric, allow negative, allow decimals etc etc. which works fine. Now I want to include that textbox control in my extended grid. So user can set all those properties while adding columns.

First of all is it possible? If yes then any tutorial or help please.

thanks in advance.

4

1 回答 1

0

我不完全确定,所以你可能想继续寻找,但据我所知,你必须手动将文本框的每个属性设置为你想要的。您无法将所有单元格样式设置复制到文本框调用。

Public Sub funwithDGVs()
    Dim DataGridView1 As New DataGridView
    Dim DataGridViewCell1 As DataGridViewCell

    DataGridViewCell1.ForeColor = Color.Aquamarine
    DataGridView1.Item(0, 1).Style.ForeColor = DataGridViewCell1.ForeColor
    TextBox1.ForeColor = DataGridViewCell1.ForeColor

End Sub
于 2013-03-18T11:18:40.627 回答