hy_honey
Messages postés67Date d'inscriptionlundi 9 mai 2005StatutMembreDernière intervention 8 août 2005
-
28 juil. 2005 à 10:32
cs_drahcir
Messages postés745Date d'inscriptionmardi 30 novembre 2004StatutMembreDernière intervention15 septembre 2009
-
28 juil. 2005 à 17:38
bonjour a tous
je suis en vb.net et je bloc depuid quelque jour , j'ai essayer de codé un drap and drop d'une liste box vers un text box c'est a dire quand je veux récuperer l'un des nom de mes client générer dans une liste box et l'afficher dans un textbox mais j'ai une erreur dans mon code.
quand je récupère un nom d'un de mes client d'une listbox vers une textbox . dans le text box cela m'affiche system.data.datarowview et je ne vois pas d'ou vient l'erreure voici mon code si si quelqu'un peu m'aider
' recuperer de la liste box le nom d'un client
Private
Sub ListBox1_MouseDown(
ByVal sender
As
Object,
ByVal e
As System.Windows.Forms.MouseEventArgs)
Handles ListBox1.MouseDown
ListBox1.DoDragDrop(ListBox1.SelectedItems(ListBox1.IndexFromPoint(e.X, e.Y).ToString).GetType.ToString, DragDropEffects.Copy
Or DragDropEffects.Move)
End
Sub
'afficher dans mon text box
Private
Sub l9_DragEnter(
ByVal sender
As
Object,
ByVal e
As System.Windows.Forms.DragEventArgs)
Handles L9.DragEnter
If (e.Data.GetDataPresent(
GetType(System.String)))
Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
End
If
End
Sub
Private
Sub l9_DragDrop(
ByVal sender
As
Object,
ByVal e
As System.Windows.Forms.DragEventArgs)
Handles L9.DragDrop
hy_honey
Messages postés67Date d'inscriptionlundi 9 mai 2005StatutMembreDernière intervention 8 août 2005 28 juil. 2005 à 11:29
j'ai bien enlever le gettype.tostring la function est devenu
Private
Sub ListBox1_MouseDown(
ByVal sender
As
Object,
ByVal e
As System.Windows.Forms.MouseEventArgs)
Handles ListBox1.MouseDown
ListBox1.DoDragDrop(ListBox1.SelectedItems(ListBox1.IndexFromPoint(e.X, e.Y)).ToString(), DragDropEffects.Copy
Or DragDropEffects.Move)
End
Sub
mais il y a toujours la meme ereur qui s'affiche sur le textbox qui est: system.data.datarowview
se qui veu dir quil ne récupere pas le nom de mon client
hy_honey
Messages postés67Date d'inscriptionlundi 9 mai 2005StatutMembreDernière intervention 8 août 2005 28 juil. 2005 à 11:52
alors avec le selecteditem sa ne marche je ne peu même pas faire le glisser déplacer et avec
L9.Text = e.Data.GetData(DataFormats.Text).ToString que vous m'aviez proposer de faire elle existe déja dans ma 3 eme procedure qui est
Private
Sub l9_DragDrop(
ByVal sender
As
Object,
ByVal e
As System.Windows.Forms.DragEventArgs)
Handles L9.DragDrop
hy_honey
Messages postés67Date d'inscriptionlundi 9 mai 2005StatutMembreDernière intervention 8 août 2005 28 juil. 2005 à 11:58
avec ListBox1.DoDragDrop(ListBox1.SelectedItems(ListBox1.Items(ListBox1.IndexFromPoint(e.X, e.Y))), DragDropEffects.Copy Or DragDropEffects.Move)
une erreure se produit qui est
Cast du type 'DataRowView' en type 'Integer' non valide.
hy_honey
Messages postés67Date d'inscriptionlundi 9 mai 2005StatutMembreDernière intervention 8 août 2005 28 juil. 2005 à 16:27
non sela ne ma pa du tous servie tu n'as pas une autre idée ou un email d'une personne que je pourrai demander??
tu vas vrément m'aider !!!!!!!! et j'en ai vraiment besoin!!!!