Dim FTB As WinForm.Table= Args(0)
Dim frm As WinForm.Form=args(1)
Dim tb As Table = FTB.Table
'Dim frm As f
If tb.count=0 Then
For Each c As WinForm.Control In frm.Controls
If Typeof c Is winform.button Then
c.Enabled=False
End If
Next
frm.controls("Btn_add").Enabled=True
Else If tb.count=1 Then
For Each c As WinForm.Control In frm.Controls
If Typeof c Is winform.button Then
c.Enabled=False
End If
Next
frm.Controls("Btn_edit").Enabled=True
frm.Controls("Btn_delete").Enabled=True
frm.controls("Btn_add").Enabled=True
Else If tb.count>1 AndAlso tb.position=tb.count-1 Then
For Each c As WinForm.Control In frm.Controls
If Typeof c Is winform.button Then
c.Enabled=True
End If
Next
frm.Controls("Btn_last").enabled=False
frm.Controls("Btn_next").enabled=False
Frm.Controls("Btn_ok").enabled=False
frm.Controls("Btn_cancel").enabled=False
Else If tb.count>1 AndAlso tb.position=0 Then
For Each c As WinForm.Control In frm.Controls
If Typeof c Is winform.button Then
c.Enabled=True
End If
Next
frm.Controls("Btn_first").enabled=False
frm.Controls("Btn_pre").enabled=False
frm.Controls("Btn_ok").enabled=False
frm.Controls("Btn_cancel").enabled=False
Else
For Each c As WinForm.Control In frm.Controls
If Typeof c Is winform.button Then
c.Enabled=True
End If
Next
frm.Controls("Btn_ok").enabled=False
frm.Controls("Btn_cancel").enabled=False
End If