Bonjour
Comme le précise le titre, j'ai beau avoir le code suivant :
La coloration fonctionne à merveille, mais aucun string n'est inséré ! Quand j'ouvre mon programme, il y a déjà du texte dans la richtextbox. Si en plein milieu je double clique sur un item de AfficherDivers, le texte déjà présent est coloré en DarkCyan, mais aucun string n'est inséré... Pourquoi ? Comment résoudre ce problème ?
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 AfficherDivers_DoubleClick(System::Object^ sender, System::EventArgs^ e) { System::String ^Temp_Select; int currentSelection = this->TriggersRedactionSpace->SelectionStart; Temp_Select = AfficherDivers->SelectedItem->ToString(); this->TriggersRedactionSpace->Text->Insert((currentSelection, (Temp_Select + "()")); if currentSelection - (Temp_Select->Length + 2) < 0 this->TriggersRedactionSpace->Select(0, (Temp_Select->Length + 2)) else this->TriggersRedactionSpace->Select(currentSelection - (Temp_Select->Length + 2), (Temp_Select->Length + 2)); this->TriggersRedactionSpace->SelectionColor = Color::DarkCyan; this->TriggersRedactionSpace->Select(currentSelection, 0); }
Merci d'avance,
Hemophilius.
Partager