读书人

请教怎么将 DataGrid 控件的第一列锁定

发布时间: 2012-03-04 11:13:34 作者: rapoo

请问如何将 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 

读书人网 >VB

热点推荐