Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why Isn't This Working???
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Why Isn't This Working???
Divers
Thread ID:
00682566
Message ID:
00682566
Vues:
42
I'v created a usercontrol called Cell. I'v also created a usercontrol called Row.
A Row can contain one or more Cells, aligned across the row one right after each
other. A Grid would therefore contain one or more Row controls.

I'm having a problem positioning the cells. This code should work, but
the last cell is off by the width of itself.

Hope that was clear. Heres the code:
Private Function GetNextCellLeftPosition() As Integer

  Dim iCell As Integer
  Dim iRetVal As Integer

  iRetVal = 0
  
  For iCell = 0 To RowCells.Count - 1
  
    If iCell = 0 Then
      iRetVal = 0
    Else
      iRetVal = iRetVal + RowCells(iCell - 1).Left + RowCells(iCell - 1).Width
    End If
   
  Next

  GetNextCellLeftPosition = iRetVal

End Function
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform