Affiche d'un tableau

manureva10 Messages postés 20 Date d'inscription samedi 22 novembre 2003 Statut Membre Dernière intervention 21 octobre 2011 - 4 janv. 2004 à 08:50
Horfee Messages postés 188 Date d'inscription mercredi 9 avril 2003 Statut Membre Dernière intervention 10 août 2009 - 4 janv. 2004 à 16:22
eric ef fournier
je voudrais aaffiche un tableau sur une form
le tableau doit avoir 100 case pour affiche les table d'addition
est il possible de le faire
merci

1 réponse

Horfee Messages postés 188 Date d'inscription mercredi 9 avril 2003 Statut Membre Dernière intervention 10 août 2009
4 janv. 2004 à 16:22
bon,j'ai pu remarquer que vos pgm sont en vb6, donc je suppose que ce pb se pose aussi sous vb6.
il y a une maniere tres simple d'afficher du texte, ou quoi que ce soit sur un form.
Pour votre exemple, j'ai fait de cette maniere :

Private Sub Form_Load()
Dim i As Integer, j As Integer
Dim DepLeft As Integer, DepTop As Integer
Dim PasHor As Integer, PasVert As Integer
DepLeft 50: DepTop 50PasHor 50: PasVert 50

For i = 1 To 9
For j = 1 To 9
Me.Line (DepLeft + (i - 1) * PasHor, DepTop)-(DepLeft + (i - 1) * PasHor, DepTop + 9 * PasVert)
Me.Line (DepLeft, DepTop + (j - 1) * PasVert)-(DepLeft + 9 * PasHor, DepTop + (j - 1) * PasVert)
Me.CurrentX = (i) * PasHor + 20 'le +20 sert a centrer un peu le texte dans la case
Me.CurrentY = (j) * PasVert + 20
Me.Print (i * j)
Next
Next
'si ces 2lignes sont omises, le tableau n'est pas fermé en bas et a droite
Me.Line (DepLeft, DepTop + 9 * PasVert)-(DepLeft + 9 * PasHor, DepTop + 9 * PasVert)
Me.Line (DepLeft + 9 * PasHor, DepTop)-(DepLeft + 9 * PasHor, DepTop + 9 * PasVert)

End Sub
0
Rejoignez-nous