How to convert to web 2.0

How do I convert this?

Public Sub SetReadOnly(Win as WebContainer, lbEnable as Boolean)
  Dim lnX, lnCount As Integer
  
  lnCount = Win.ControlsCount - 1
  
  
  for lnX = 0 to lnCount
    if Win.ControlAtIndex(lnX) IsA WebTextField then
      WebTextField(Win.ControlAtIndex(lnX)).Readonly = Not lbEnable
    end
    if Win.ControlAtIndex(lnX) IsA WebCheckBox then
      WebCheckBox(Win.ControlAtIndex(lnX)).Enabled = lbEnable
    end
    if Win.ControlAtIndex(lnX) IsA WebPopupMenu then
      WebPopupMenu(Win.ControlAtIndex(lnX)).Enabled = lbEnable
    end
    
  next
  
End Sub

Thanks

ControlsCount is now LastControlIndex
ControlAtIndex is now ControlAt