Bonjour,
voilà j'ai du rater un chapitre du C++je ne comprend pour pourquoi quand je crée avec l'éditeur de form, une fenetre avec un picturebox j'ai ca:
Et lorsque je veux crée ca moi même (créé ma form avec une picturebox lors de l'appui sur un bouton d'une autre form) :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 System::Windows::Forms::PictureBox * curve; void InitializeComponent(void) { ... this->curve = (new System::Windows::Forms::PictureBox()); ... this->curve->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; this->curve->Location = System::Drawing::Point(30, 50); this->curve->Name = S"curve"; ... }
j'ai l'erreur suivante sur la ligne rouge:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 System::Void Form1::bt_histogramme_Click(System::Object* sender, System::EventArgs* e) { System::Windows::Forms::Form * principal = new System::Windows::Forms::Form(); System::Windows::Forms::PictureBox * courbe = new System::Windows::Forms::PictureBox(); principal->courbe = (new System::Windows::Forms::PictureBox()); principal->Show(); }
error C2039: 'courbe'*: n'est pas membre de 'System::Windows::Forms::Form'
Si je crée juste la form et fait le Show, aucun problème...
Partager