XGuarden
Messages postés259Date d'inscriptiondimanche 14 juillet 2002StatutMembreDernière intervention17 août 2012
-
9 déc. 2006 à 03:42
XGuarden
Messages postés259Date d'inscriptiondimanche 14 juillet 2002StatutMembreDernière intervention17 août 2012
-
9 déc. 2006 à 12:10
Bonjour, dans une form j'utilise un scroolbal mais pour une raison que je ne comprend pas, ce ne marche pas. J'esplique.
J'ajoute dynamiquement des controles dans un tableLayoutPanel et je déside défiler selon les enregistrements(comme vous le ocmprendrer en regardant le code ci-dessous). Mais pour une raison inexplicable, les deux premier controle créer dynamiquement son plus espacé que le reste. Mon tableLayoutPanel au commencement a deux colonne et une ligne.....
QUi pourais m'Expliquer pq sa me donne sa, si vous vouler je vous envoie la source, laisser moi simplement votre email. MErci, car je galere la.
Private Sub cmdApliquer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdApliquer.Click
Static x As Integer = 0
x += 1
Private Function GetLabel(ByVal texte As String) As Label
Static index As Integer = 0
Dim x As New Label
x.AutoSize = True
x.Location = New System.Drawing.Point(0, 0)
x.Name = "lblinfo" & index.ToString
x.Size = New System.Drawing.Size(80, 20)
x.TabIndex = 3000
x.Text = texte
x.Dock = DockStyle.Fill
AddHandler x.Click, AddressOf CatchEventLAbel
'x.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
index = index + 1
Return x
End Function
Private Function GetTextBox(ByVal texte As String) As TextBox
Static index As Integer = 0
Dim y As New TextBox
y.Location = New System.Drawing.Point(0, 0)
y.Name = "txtinfo" & index.ToString
y.Size = New System.Drawing.Size(80, 20)
y.TabIndex = 12
y.Text = texte
y.Dock = DockStyle.Fill
index = index + 1
Return y
End Function
Private Sub CatchEventLAbel(ByVal sender As Object, ByVal e As System.EventArgs)
MsgBox(CType(sender, Label).Name)
End Sub
Private Sub vScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles vScrollBar1.Scroll
tableLayoutPanel1.Top = vScrollBar1.Value * -25
End Sub