首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

请教怎么将 DataGrid 控件的第一列锁定,使其不能更改,但其它的列可以更改

2012-03-04 
请问如何将 DataGrid 控件的第一列锁定,使其不能更改,但其它的列可以更改。请问如何将 DataGrid 控件的第一

请问如何将 DataGrid 控件的第一列锁定,使其不能更改,但其它的列可以更改。
请问如何将 DataGrid 控件的第一列锁定,使其不能更改,但其它的列可以更改。
谢谢!

[解决办法]
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
If DataGrid1.Col = 1 Then
DataGrid1.AllowUpdate = False
Else
DataGrid1.AllowUpdate = True
End If
End Sub

[解决办法]

VB code
Private Sub Form_Load()    DataGrid1.Columns(1).Locked = TrueEnd Sub 

热点排行