FrostByte
Messages postés138Date d'inscriptionmercredi 4 avril 2001StatutMembreDernière intervention28 janvier 2006 6 déc. 2002 à 18:04
euh oui !! si tu le dits !! je te remerci(e) !!!
VicoLaChips2
Messages postés436Date d'inscriptiondimanche 20 janvier 2002StatutMembreDernière intervention 2 février 20102 6 déc. 2002 à 13:44
Hello -:)
j'ai une autre version :
Option Explicit
'-------------
Private Sub btnCmd_Click(Index As Integer)
Dim str As String, str2 As String
With lstBox
If .ListIndex = -1 Then Exit Sub
str = .List(.ListIndex)
Select Case Index
Case 0 'top
str2 = .List(0)
If str2 = "" Then Exit Sub
.List(0) = str
.List(.ListIndex) = str2
.ListIndex = 0
Case 1 'up1
str2 = .List(.ListIndex - 1)
If str2 = "" Then Exit Sub
.List(.ListIndex) = str2
.List(.ListIndex - 1) = str
.ListIndex = .ListIndex - 1
Case 2 'down1
str2 = .List(.ListIndex + 1)
If str2 = "" Then Exit Sub
.List(.ListIndex) = str2
.List(.ListIndex + 1) = str
.ListIndex = .ListIndex + 1
Case 3 'bottom
str2 = .List(.ListCount - 1)
If str2 = "" Then Exit Sub
.List(.ListCount - 1) = str
.List(.ListIndex) = str2
.ListIndex = .ListCount - 1
End Select
End With
End Sub
Private Sub Form_Load()
Dim i As Byte
For i = 0 To 127
lstBox.AddItem "Item " & i
Next
End Sub
'---------
'un listBox >> listBox
'et un btnCmd (de 0 à 3) 0 premier, 1 place précédente etc...
@+, VIC
FrostByte
Messages postés138Date d'inscriptionmercredi 4 avril 2001StatutMembreDernière intervention28 janvier 2006 5 déc. 2002 à 21:56
ouais je reconnais que je code pas trés bien, mais bon le principe y est (et je pense que sur vbfrance une source de ce type n'y est pas !!)
cs_blabla
Messages postés112Date d'inscriptionmercredi 28 août 2002StatutMembreDernière intervention13 mars 2004 5 déc. 2002 à 21:00
ouais le code est bien , mais pour le consepte c 1 pe la merde apret avoir tou changer ;)
6 déc. 2002 à 18:04
6 déc. 2002 à 13:44
j'ai une autre version :
Option Explicit
'-------------
Private Sub btnCmd_Click(Index As Integer)
Dim str As String, str2 As String
With lstBox
If .ListIndex = -1 Then Exit Sub
str = .List(.ListIndex)
Select Case Index
Case 0 'top
str2 = .List(0)
If str2 = "" Then Exit Sub
.List(0) = str
.List(.ListIndex) = str2
.ListIndex = 0
Case 1 'up1
str2 = .List(.ListIndex - 1)
If str2 = "" Then Exit Sub
.List(.ListIndex) = str2
.List(.ListIndex - 1) = str
.ListIndex = .ListIndex - 1
Case 2 'down1
str2 = .List(.ListIndex + 1)
If str2 = "" Then Exit Sub
.List(.ListIndex) = str2
.List(.ListIndex + 1) = str
.ListIndex = .ListIndex + 1
Case 3 'bottom
str2 = .List(.ListCount - 1)
If str2 = "" Then Exit Sub
.List(.ListCount - 1) = str
.List(.ListIndex) = str2
.ListIndex = .ListCount - 1
End Select
End With
End Sub
Private Sub Form_Load()
Dim i As Byte
For i = 0 To 127
lstBox.AddItem "Item " & i
Next
End Sub
'---------
'un listBox >> listBox
'et un btnCmd (de 0 à 3) 0 premier, 1 place précédente etc...
@+, VIC
5 déc. 2002 à 21:56
5 déc. 2002 à 21:00