Bonjour,

Je travail avec visual studio 2005 dans un projet Application Windows Forms je doit créer un menu et j'ai un probleme, j aimerai avoir une fonction qui me permet de couper du texte dans un textarea à partir d'un menu "edition"->"couper".
Lorque j'utilise la methode Cut(); le compilateur m'insulte. Je ne vois vraiement pas comment faire si quelqu'un pouvai m'aider se serai sympas.

Voici mon code :
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
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
 
 
#pragma once
 
 
namespace ExerciceForm {
 
	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;
 
 
		public ref class Form1 : public System::Windows::Forms::Form
	{
	public:
		Form1(void)
		{
			InitializeComponent();
 
		}
 
	protected:
				~Form1()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::Button^  closeButton;
	private: System::Windows::Forms::MenuStrip^  menuStrip1;
	private: System::Windows::Forms::ToolStripMenuItem^  fichierToolStripMenuItem;
	private: System::Windows::Forms::ToolStripMenuItem^  ouvrirToolStripMenuItem;
	private: System::Windows::Forms::ToolStripMenuItem^  fermerToolStripMenuItem;
	private: System::Windows::Forms::ToolStripMenuItem^  editionToolStripMenuItem;
	private: System::Windows::Forms::ToolStripMenuItem^  copierToolStripMenuItem;
	private: System::Windows::Forms::ToolStripMenuItem^  collerToolStripMenuItem;
	private: System::Windows::Forms::ToolStripMenuItem^  couperToolStripMenuItem;
	private: System::Windows::Forms::TextBox^  textBox1;
 
	protected: 
 
	private:
				System::ComponentModel::Container ^components;
 
#pragma region Windows Form Designer generated code
				void InitializeComponent(void)
		{
			this->label1 = (gcnew System::Windows::Forms::Label());
			this->closeButton = (gcnew System::Windows::Forms::Button());
			this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
			this->fichierToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->editionToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->copierToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->collerToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->ouvrirToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->fermerToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->textBox1 = (gcnew System::Windows::Forms::TextBox());
			this->couperToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuStrip1->SuspendLayout();
			this->SuspendLayout();
			// 
			// label1
			// 
			this->label1->AutoSize = true;
			this->label1->Location = System::Drawing::Point(9, 43);
			this->label1->Name = L"label1";
			this->label1->Size = System::Drawing::Size(28, 13);
			this->label1->TabIndex = 0;
			this->label1->Text = L"Titre";
			this->label1->Click += gcnew System::EventHandler(this, &Form1::label1_Click);
			// 
			// closeButton
			// 
			this->closeButton->Location = System::Drawing::Point(12, 184);
			this->closeButton->Name = L"closeButton";
			this->closeButton->Size = System::Drawing::Size(82, 23);
			this->closeButton->TabIndex = 1;
			this->closeButton->Text = L"Fermer";
			this->closeButton->UseVisualStyleBackColor = true;
			this->closeButton->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
			// 
			// menuStrip1
			// 
			this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->fichierToolStripMenuItem, 
				this->editionToolStripMenuItem});
			this->menuStrip1->Location = System::Drawing::Point(0, 0);
			this->menuStrip1->Name = L"menuStrip1";
			this->menuStrip1->Size = System::Drawing::Size(292, 24);
			this->menuStrip1->TabIndex = 2;
			this->menuStrip1->Text = L"menuStrip1";
			// 
			// fichierToolStripMenuItem
			// 
			this->fichierToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->ouvrirToolStripMenuItem, 
			this->fermerToolStripMenuItem});
			this->fichierToolStripMenuItem->Name = L"fichierToolStripMenuItem";
			this->fichierToolStripMenuItem->Size = System::Drawing::Size(50, 20);
			this->fichierToolStripMenuItem->Text = L"Fichier";
			// 
			// editionToolStripMenuItem
			// 
			this->editionToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(3) {this->copierToolStripMenuItem, 
				this->collerToolStripMenuItem, this->couperToolStripMenuItem});
			this->editionToolStripMenuItem->Name = L"editionToolStripMenuItem";
			this->editionToolStripMenuItem->Size = System::Drawing::Size(51, 20);
			this->editionToolStripMenuItem->Text = L"Edition";
			// 
			// copierToolStripMenuItem
			// 
			this->copierToolStripMenuItem->Name = L"copierToolStripMenuItem";
			this->copierToolStripMenuItem->Size = System::Drawing::Size(152, 22);
			this->copierToolStripMenuItem->Text = L"Copier";
			// 
			// collerToolStripMenuItem
			// 
			this->collerToolStripMenuItem->Name = L"collerToolStripMenuItem";
			this->collerToolStripMenuItem->Size = System::Drawing::Size(152, 22);
			this->collerToolStripMenuItem->Text = L"Coller";
			// 
			// ouvrirToolStripMenuItem
			// 
			this->ouvrirToolStripMenuItem->Name = L"ouvrirToolStripMenuItem";
			this->ouvrirToolStripMenuItem->Size = System::Drawing::Size(152, 22);
			this->ouvrirToolStripMenuItem->Text = L"Ouvrir";
			// 
			// fermerToolStripMenuItem
			// 
			this->fermerToolStripMenuItem->Name = L"fermerToolStripMenuItem";
			this->fermerToolStripMenuItem->Size = System::Drawing::Size(152, 22);
			this->fermerToolStripMenuItem->Text = L"Fermer";
			this->fermerToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::fermerToolStripMenuItem_Click);
			// 
			// textBox1
			// 
			this->textBox1->Location = System::Drawing::Point(12, 71);
			this->textBox1->Multiline = true;
			this->textBox1->Name = L"textBox1";
			this->textBox1->Size = System::Drawing::Size(268, 107);
			this->textBox1->TabIndex = 3;
			// 
			// couperToolStripMenuItem
			// 
			this->couperToolStripMenuItem->Name = L"couperToolStripMenuItem";
			this->couperToolStripMenuItem->Size = System::Drawing::Size(152, 22);
			this->couperToolStripMenuItem->Text = L"Couper";
			this->couperToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::couperToolStripMenuItem_Click);
			// 
			// Form1
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(292, 273);
			this->Controls->Add(this->textBox1);
			this->Controls->Add(this->closeButton);
			this->Controls->Add(this->label1);
			this->Controls->Add(this->menuStrip1);
			this->MainMenuStrip = this->menuStrip1;
			this->Name = L"Form1";
			this->Text = L"Form1";
			this->menuStrip1->ResumeLayout(false);
			this->menuStrip1->PerformLayout();
			this->ResumeLayout(false);
			this->PerformLayout();
 
		}
#pragma endregion
	private: System::Void label1_Click(System::Object^  sender, System::EventArgs^  e) {
			 }
	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
				 Close();
			 }
	private: System::Void fermerToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
				 Close();
			 }
    private: System::Void couperToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
				 //methode cut(); pose pb
			 }
	};
}