Bonjour,
J'ai un pb de r�cup�ration de text avec le Click droit de la souris, je dois mal mis prendre ou �a ne fonctionne pas dans une listBox.
PB = J'ai une listBox1 avec diff�rente ligne.
En Cliquant sur le bouton gauche de la souris, je r�cup�re bien le Text.
En Cliquant sur le bouton droit de la souris, je r�cup�re un Text "" vide. Je r�cup�re bien mon MessageBox pourtant ? !!!
Je ne comprend pas trop pourquoi. Je ne doit pas utiliser la bonne m�thode.
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 private: System::Void listBoxFichier_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { // Bouton Gauche de la souris enfoncé. if (e->Button == System::Windows::Forms::MouseButtons::Left) { zFichierOuvre = listBoxFichier->Text + ".pat" ; // Pensez a remettre l'extension car OUVERTURE_PARTIE attend un fichier avec extension. OUVERTURE_PARTIE(zFichierOuvre) ; } // Bouton Droit de la souris enfoncé. if (e->Button == System::Windows::Forms::MouseButtons::Right) { zFichierOuvre = listBoxFichier->Text + ".pat" ; SUPPRIMER_FICHIER(zFichierOuvre) ; MessageBox::Show("Click Droit ok"); } }
J'utilise un �v�nement ( MouseDown ). j'ai essay� avec tous plein d'�v�nement diff�rents. J'utilise Visual C++2005 express.
Merci d'avance.
Partager