1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
this->commande = (gcnew System::Windows::Forms::CheckedListBox());
// commande
//
this->commande->FormattingEnabled = true;
this->commande->Location = System::Drawing::Point(4, 4);
this->commande->Margin = System::Windows::Forms::Padding(0);
this->commande->Name = L"commande";
this->commande->Size = System::Drawing::Size(1011, 679);
this->commande->TabIndex = 3;
CE QUE MOI J'AI ECRIT :
private: System::Void suppr_Load(System::Object^ sender, System::EventArgs^ e) {
String ^fichier=this->store;
if ( !File::Exists(fichier) )
{
//Afficher un message
MessageBox::Show("Aucune commande enregistrée","Chidori",MessageBoxButtons::OK,MessageBoxIcon::Information);
this->Close();
}
else
{
StreamReader ^sw = File::OpenText(fichier);
try
{
String ^ligne="";
String ^ligne2="";
this->i=0;
while(ligne=sw->ReadLine())
{
ligne2=ligne+"\r\n";
this->commande->Items->Add(ligne2,0);
this->i++;
}
this->i--;
}
finally
{
if ( sw )
delete (IDisposable^)sw;
}
}
}
private: System::Void exit_Click(System::Object^ sender, System::EventArgs^ e) {
this->Close();
}
CECI FONCTIONNE |
Partager