IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C++/CLI Discussion :

Probleme avec Form1_DragEnter


Sujet :

C++/CLI

  1. #1
    Membre averti
    Inscrit en
    Mai 2007
    Messages
    45
    Détails du profil
    Informations forums :
    Inscription : Mai 2007
    Messages : 45
    Par défaut Probleme avec Form1_DragEnter
    Voila j'ai crée une petite appli ou je crée en Graphics une petite bar de position pour pouvoir naviguer dans une video. En gros le meme principe qu'un lecteur video.
    Pour l'instant, l'utilisateur peux cliquer sur cette barre pour l'amener ou il le souhaite dans la video. Mais j'aimerais maitenant qu'il puisse faire du drag sur cette bar. J'ai donc crée cette fonction :

    déclaration :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    this->DragEnter += gcnew System::Windows::Forms::DragEventHandler(this, &Form1::Form1_DragEnter);
    événement :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    private: System::Void Form1_DragEnter(System::Object ^  sender,System::Windows::Forms::DragEventArgs ^  e)
    		 {
     
    			//bla bla bla
     
    		 }
    Mon souci est qu'apparement Form1_DragEnter n'est pas membre de MaForm::Form1. J'ai regardé sur le net et tout le monde le déclare comme ca. Alors je ne sais pas pourquoi chez moi ca ne marche pas...

    PS: Pour précision, pour mon appli, il vaut utiliser quel type de Drag, DragEnter, DragDrop ? En fait j'ai juste besoin de connaitre en temps réel les coordonnées de la souris


    Merci de votre aide !

  2. #2
    Rédacteur
    Avatar de Thomas Lebrun
    Profil pro
    Inscrit en
    Octobre 2002
    Messages
    9 161
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Octobre 2002
    Messages : 9 161
    Par défaut
    Voyons voir ce que les gens de C++/CLI en pensent

  3. #3
    Rédacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par défaut
    tu as utilisé l'assistant pour générer la fonction ?

  4. #4
    Membre averti
    Inscrit en
    Mai 2007
    Messages
    45
    Détails du profil
    Informations forums :
    Inscription : Mai 2007
    Messages : 45
    Par défaut
    Non je l'ai généré moi meme.

    Aurais je oublié quelquechose, parceque pour les autres événements que j'ai crée, ca marchait tres bien !

  5. #5
    Rédacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par défaut
    on peut ptete voir tout le code et l'erreur du compilo ?

    question con, tu as bien mis dans la méthode dans la classe ? dans le meme .h ? dans un .cpp ? (si oui, n'as-tu pas oublié l'opérateur de résolution de portée ? et le namespace ?)

  6. #6
    Membre averti
    Inscrit en
    Mai 2007
    Messages
    45
    Détails du profil
    Informations forums :
    Inscription : Mai 2007
    Messages : 45
    Par défaut
    Bon voila 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
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
     
    #pragma once
     
    #pragma managed(push,off)
    #include <cv.h>
    #include <highgui.h>
    #include <cxcore.h>
    #pragma managed(pop)
    #include <stdio.h>
    #include "string.h"
    #include "stdafx.h"
    #include <vector>
     
    /* Global variable */
     
    /* Loading the video */
    std::vector <IplImage*> FrameVector;
    double nbr_frame;
    CvCapture *avi;
     
     
    /* Global variable */
     
     
     
    namespace VideoInterface_10 {
     
    	using namespace System;
    	using namespace System::ComponentModel;
    	using namespace System::Collections;
    	using namespace System::Windows::Forms;
    	using namespace System::Data;
    	using namespace System::Drawing;
     
     
     
    	/// <summary>
    	/// Description résumée de Form1
    	///
    	/// AVERTISSEMENT : si vous modifiez le nom de cette classe, vous devrez modifier la
    	///          propriété 'Nom du fichier de ressources' de l'outil de compilation de ressource managée
    	///          pour tous les fichiers .resx dont dépend cette classe. Dans le cas contraire,
    	///          les concepteurs ne pourront pas interagir correctement avec les ressources
    	///          localisées associées à ce formulaire.
    	/// </summary>
    	public ref class Form1 : public System::Windows::Forms::Form
    	{
    	public:
    		Form1(void)
    		{
    			InitializeComponent();
    			//
    			//TODO : ajoutez ici le code du constructeur
    			//
    		}
     
    	protected:
    		/// <summary>
    		/// Nettoyage des ressources utilisées.
    		/// </summary>
    		~Form1()
    		{
    			if (components)
    			{
    				delete components;
    			}
    		}
     
    	protected: 
    	private: System::Windows::Forms::PictureBox^  pictureBox1;
    	private: System::Windows::Forms::PictureBox^  pictureBox2;
    	private: System::Windows::Forms::PictureBox^  pictureBox3;
    	private: System::Windows::Forms::PictureBox^  pictureBox4;
    	private: System::Windows::Forms::PictureBox^  pictureBox5;
    	private: System::Windows::Forms::PictureBox^  pictureBox6;
    	private: System::Windows::Forms::PictureBox^  pictureBox7;
    	private: System::Windows::Forms::PictureBox^  pictureBox8;
    	private: System::Windows::Forms::PictureBox^  pictureBox9;
    	private: System::Windows::Forms::MenuStrip^  menuStrip2;
    	private: System::Windows::Forms::ToolStripMenuItem^  fileToolStripMenuItem;
    	private: System::Windows::Forms::ToolStripMenuItem^  openToolStripMenuItem;
    	private: System::Windows::Forms::ToolStripMenuItem^  exitToolStripMenuItem;
     
    	private: System::Windows::Forms::TextBox^  textBox1;
    	private: System::Windows::Forms::PictureBox^  pictureBox10;
    	private: System::Windows::Forms::PictureBox^  pictureBox11;
    	private: System::Windows::Forms::PictureBox^  pictureBox12;
     
    	private: System::Windows::Forms::NumericUpDown^  numericUpDown1;
    	private: System::Windows::Forms::Label^  label1;
     
    	private: System::Windows::Forms::NumericUpDown^  numericUpDown2;
    	private: System::Windows::Forms::Label^  label2;
    	private: System::Windows::Forms::OpenFileDialog^  openFileDialog1;
    	private: System::Windows::Forms::ErrorProvider^  errorProvider1;
    	private: System::Windows::Forms::PictureBox^  pictureBox14;
    	private: System::ComponentModel::IContainer^  components;
    	private:
    		/// <summary>
    		/// Variable nécessaire au concepteur.
    		/// </summary>
     
    #pragma region Windows Form Designer generated code
    		/// <summary>
    		/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
    		/// le contenu de cette méthode avec l'éditeur de code.
    		/// </summary>
    		void InitializeComponent(void)
    		{
    			this->components = (gcnew System::ComponentModel::Container());
    			this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
    			this->pictureBox2 = (gcnew System::Windows::Forms::PictureBox());
    			this->pictureBox3 = (gcnew System::Windows::Forms::PictureBox());
    			this->pictureBox4 = (gcnew System::Windows::Forms::PictureBox());
    			this->pictureBox5 = (gcnew System::Windows::Forms::PictureBox());
    			this->pictureBox6 = (gcnew System::Windows::Forms::PictureBox());
    			this->pictureBox7 = (gcnew System::Windows::Forms::PictureBox());
    			this->pictureBox8 = (gcnew System::Windows::Forms::PictureBox());
    			this->pictureBox9 = (gcnew System::Windows::Forms::PictureBox());
    			this->menuStrip2 = (gcnew System::Windows::Forms::MenuStrip());
    			this->fileToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
    			this->openToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
    			this->exitToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
    			this->textBox1 = (gcnew System::Windows::Forms::TextBox());
    			this->pictureBox10 = (gcnew System::Windows::Forms::PictureBox());
    			this->pictureBox11 = (gcnew System::Windows::Forms::PictureBox());
    			this->pictureBox12 = (gcnew System::Windows::Forms::PictureBox());
    			this->numericUpDown1 = (gcnew System::Windows::Forms::NumericUpDown());
    			this->label1 = (gcnew System::Windows::Forms::Label());
    			this->numericUpDown2 = (gcnew System::Windows::Forms::NumericUpDown());
    			this->label2 = (gcnew System::Windows::Forms::Label());
    			this->openFileDialog1 = (gcnew System::Windows::Forms::OpenFileDialog());
    			this->errorProvider1 = (gcnew System::Windows::Forms::ErrorProvider(this->components));
    			this->pictureBox14 = (gcnew System::Windows::Forms::PictureBox());
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox1))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox2))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox3))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox4))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox5))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox6))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox7))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox8))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox9))->BeginInit();
    			this->menuStrip2->SuspendLayout();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox10))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox11))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox12))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDown1))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDown2))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->errorProvider1))->BeginInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox14))->BeginInit();
    			this->SuspendLayout();
    			// 
    			// pictureBox1
    			// 
    			this->pictureBox1->Location = System::Drawing::Point(10, 36);
    			this->pictureBox1->Margin = System::Windows::Forms::Padding(1);
    			this->pictureBox1->MinimumSize = System::Drawing::Size(10, 10);
    			this->pictureBox1->Name = L"pictureBox1";
    			this->pictureBox1->Size = System::Drawing::Size(80, 64);
    			this->pictureBox1->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
    			this->pictureBox1->TabIndex = 1;
    			this->pictureBox1->TabStop = false;
    			this->pictureBox1->Click += gcnew System::EventHandler(this, &Form1::pictureBox1_Click);
    			// 
    			// pictureBox2
    			// 
    			this->pictureBox2->Location = System::Drawing::Point(92, 36);
    			this->pictureBox2->Margin = System::Windows::Forms::Padding(1);
    			this->pictureBox2->Name = L"pictureBox2";
    			this->pictureBox2->Size = System::Drawing::Size(80, 64);
    			this->pictureBox2->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
    			this->pictureBox2->TabIndex = 2;
    			this->pictureBox2->TabStop = false;
    			this->pictureBox2->Click += gcnew System::EventHandler(this, &Form1::pictureBox2_Click);
    			// 
    			// pictureBox3
    			// 
    			this->pictureBox3->Location = System::Drawing::Point(174, 36);
    			this->pictureBox3->Margin = System::Windows::Forms::Padding(1);
    			this->pictureBox3->Name = L"pictureBox3";
    			this->pictureBox3->Size = System::Drawing::Size(80, 64);
    			this->pictureBox3->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
    			this->pictureBox3->TabIndex = 3;
    			this->pictureBox3->TabStop = false;
    			this->pictureBox3->Click += gcnew System::EventHandler(this, &Form1::pictureBox3_Click);
    			// 
    			// pictureBox4
    			// 
    			this->pictureBox4->Location = System::Drawing::Point(256, 36);
    			this->pictureBox4->Margin = System::Windows::Forms::Padding(1);
    			this->pictureBox4->Name = L"pictureBox4";
    			this->pictureBox4->Size = System::Drawing::Size(80, 64);
    			this->pictureBox4->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
    			this->pictureBox4->TabIndex = 4;
    			this->pictureBox4->TabStop = false;
    			this->pictureBox4->Click += gcnew System::EventHandler(this, &Form1::pictureBox4_Click);
    			// 
    			// pictureBox5
    			// 
    			this->pictureBox5->Location = System::Drawing::Point(338, 36);
    			this->pictureBox5->Margin = System::Windows::Forms::Padding(1);
    			this->pictureBox5->Name = L"pictureBox5";
    			this->pictureBox5->Size = System::Drawing::Size(80, 64);
    			this->pictureBox5->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
    			this->pictureBox5->TabIndex = 5;
    			this->pictureBox5->TabStop = false;
    			this->pictureBox5->Click += gcnew System::EventHandler(this, &Form1::pictureBox5_Click);
    			// 
    			// pictureBox6
    			// 
    			this->pictureBox6->Location = System::Drawing::Point(420, 36);
    			this->pictureBox6->Margin = System::Windows::Forms::Padding(1);
    			this->pictureBox6->MinimumSize = System::Drawing::Size(10, 10);
    			this->pictureBox6->Name = L"pictureBox6";
    			this->pictureBox6->Size = System::Drawing::Size(80, 64);
    			this->pictureBox6->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
    			this->pictureBox6->TabIndex = 6;
    			this->pictureBox6->TabStop = false;
    			this->pictureBox6->Click += gcnew System::EventHandler(this, &Form1::pictureBox6_Click);
    			// 
    			// pictureBox7
    			// 
    			this->pictureBox7->Location = System::Drawing::Point(504, 36);
    			this->pictureBox7->Margin = System::Windows::Forms::Padding(1);
    			this->pictureBox7->MinimumSize = System::Drawing::Size(10, 10);
    			this->pictureBox7->Name = L"pictureBox7";
    			this->pictureBox7->Size = System::Drawing::Size(80, 64);
    			this->pictureBox7->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
    			this->pictureBox7->TabIndex = 7;
    			this->pictureBox7->TabStop = false;
    			this->pictureBox7->Click += gcnew System::EventHandler(this, &Form1::pictureBox7_Click);
    			// 
    			// pictureBox8
    			// 
    			this->pictureBox8->Location = System::Drawing::Point(586, 36);
    			this->pictureBox8->Margin = System::Windows::Forms::Padding(1);
    			this->pictureBox8->MinimumSize = System::Drawing::Size(10, 10);
    			this->pictureBox8->Name = L"pictureBox8";
    			this->pictureBox8->Size = System::Drawing::Size(80, 64);
    			this->pictureBox8->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
    			this->pictureBox8->TabIndex = 8;
    			this->pictureBox8->TabStop = false;
    			this->pictureBox8->Click += gcnew System::EventHandler(this, &Form1::pictureBox8_Click);
    			// 
    			// pictureBox9
    			// 
    			this->pictureBox9->Location = System::Drawing::Point(668, 36);
    			this->pictureBox9->Margin = System::Windows::Forms::Padding(1);
    			this->pictureBox9->MinimumSize = System::Drawing::Size(10, 10);
    			this->pictureBox9->Name = L"pictureBox9";
    			this->pictureBox9->Size = System::Drawing::Size(80, 64);
    			this->pictureBox9->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
    			this->pictureBox9->TabIndex = 9;
    			this->pictureBox9->TabStop = false;
    			this->pictureBox9->Click += gcnew System::EventHandler(this, &Form1::pictureBox9_Click);
    			// 
    			// menuStrip2
    			// 
    			this->menuStrip2->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->fileToolStripMenuItem});
    			this->menuStrip2->Location = System::Drawing::Point(0, 0);
    			this->menuStrip2->Name = L"menuStrip2";
    			this->menuStrip2->Size = System::Drawing::Size(1018, 24);
    			this->menuStrip2->TabIndex = 10;
    			this->menuStrip2->Text = L"menuStrip2";
    			// 
    			// fileToolStripMenuItem
    			// 
    			this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->openToolStripMenuItem, 
    				this->exitToolStripMenuItem});
    			this->fileToolStripMenuItem->Name = L"fileToolStripMenuItem";
    			this->fileToolStripMenuItem->Size = System::Drawing::Size(35, 20);
    			this->fileToolStripMenuItem->Text = L"File";
    			// 
    			// openToolStripMenuItem
    			// 
    			this->openToolStripMenuItem->Name = L"openToolStripMenuItem";
    			this->openToolStripMenuItem->Size = System::Drawing::Size(111, 22);
    			this->openToolStripMenuItem->Text = L"Open";
    			this->openToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::openToolStripMenuItem_Click);
    			// 
    			// exitToolStripMenuItem
    			// 
    			this->exitToolStripMenuItem->Name = L"exitToolStripMenuItem";
    			this->exitToolStripMenuItem->Size = System::Drawing::Size(111, 22);
    			this->exitToolStripMenuItem->Text = L"Exit";
    			this->exitToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::exitToolStripMenuItem_Click);
    			// 
    			// textBox1
    			// 
    			this->textBox1->Location = System::Drawing::Point(760, 377);
    			this->textBox1->Name = L"textBox1";
    			this->textBox1->Size = System::Drawing::Size(185, 20);
    			this->textBox1->TabIndex = 12;
    			// 
    			// pictureBox10
    			// 
    			this->pictureBox10->Location = System::Drawing::Point(750, 36);
    			this->pictureBox10->Margin = System::Windows::Forms::Padding(1);
    			this->pictureBox10->Name = L"pictureBox10";
    			this->pictureBox10->Size = System::Drawing::Size(80, 64);
    			this->pictureBox10->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
    			this->pictureBox10->TabIndex = 13;
    			this->pictureBox10->TabStop = false;
    			this->pictureBox10->Click += gcnew System::EventHandler(this, &Form1::pictureBox10_Click);
    			// 
    			// pictureBox11
    			// 
    			this->pictureBox11->Location = System::Drawing::Point(832, 36);
    			this->pictureBox11->Margin = System::Windows::Forms::Padding(1);
    			this->pictureBox11->Name = L"pictureBox11";
    			this->pictureBox11->Size = System::Drawing::Size(80, 64);
    			this->pictureBox11->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
    			this->pictureBox11->TabIndex = 14;
    			this->pictureBox11->TabStop = false;
    			this->pictureBox11->Click += gcnew System::EventHandler(this, &Form1::pictureBox11_Click);
    			// 
    			// pictureBox12
    			// 
    			this->pictureBox12->Location = System::Drawing::Point(914, 36);
    			this->pictureBox12->Margin = System::Windows::Forms::Padding(1);
    			this->pictureBox12->Name = L"pictureBox12";
    			this->pictureBox12->Size = System::Drawing::Size(80, 64);
    			this->pictureBox12->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
    			this->pictureBox12->TabIndex = 15;
    			this->pictureBox12->TabStop = false;
    			this->pictureBox12->Click += gcnew System::EventHandler(this, &Form1::pictureBox12_Click);
    			// 
    			// numericUpDown1
    			// 
    			this->numericUpDown1->Location = System::Drawing::Point(115, 246);
    			this->numericUpDown1->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {2, 0, 0, 0});
    			this->numericUpDown1->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
    			this->numericUpDown1->Name = L"numericUpDown1";
    			this->numericUpDown1->Size = System::Drawing::Size(52, 20);
    			this->numericUpDown1->TabIndex = 17;
    			this->numericUpDown1->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
    			this->numericUpDown1->ValueChanged += gcnew System::EventHandler(this, &Form1::numericUpDown1_ValueChanged);
    			// 
    			// label1
    			// 
    			this->label1->AutoSize = true;
    			this->label1->BackColor = System::Drawing::SystemColors::GrayText;
    			this->label1->Location = System::Drawing::Point(70, 196);
    			this->label1->Name = L"label1";
    			this->label1->Size = System::Drawing::Size(147, 13);
    			this->label1->TabIndex = 18;
    			this->label1->Text = L"Distance between two frames";
    			// 
    			// numericUpDown2
    			// 
    			this->numericUpDown2->Location = System::Drawing::Point(812, 246);
    			this->numericUpDown2->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
    			this->numericUpDown2->Name = L"numericUpDown2";
    			this->numericUpDown2->Size = System::Drawing::Size(56, 20);
    			this->numericUpDown2->TabIndex = 20;
    			this->numericUpDown2->ValueChanged += gcnew System::EventHandler(this, &Form1::numericUpDown2_ValueChanged);
    			// 
    			// label2
    			// 
    			this->label2->AutoSize = true;
    			this->label2->BackColor = System::Drawing::SystemColors::GrayText;
    			this->label2->Location = System::Drawing::Point(790, 196);
    			this->label2->Name = L"label2";
    			this->label2->Size = System::Drawing::Size(122, 13);
    			this->label2->TabIndex = 21;
    			this->label2->Text = L"Number of the first frame";
    			// 
    			// openFileDialog1
    			// 
    			this->openFileDialog1->FileName = L"openFileDialog1";
    			this->openFileDialog1->Filter = L"Fichiers avi|*.avi";
    			this->openFileDialog1->InitialDirectory = L"c:";
    			this->openFileDialog1->Title = L"Open";
    			// 
    			// errorProvider1
    			// 
    			this->errorProvider1->ContainerControl = this;
    			// 
    			// pictureBox14
    			// 
    			this->pictureBox14->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
    			this->pictureBox14->Location = System::Drawing::Point(338, 127);
    			this->pictureBox14->Name = L"pictureBox14";
    			this->pictureBox14->Size = System::Drawing::Size(328, 270);
    			this->pictureBox14->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
    			this->pictureBox14->TabIndex = 22;
    			this->pictureBox14->TabStop = false;
    			this->pictureBox14->Visible = false;
    			this->pictureBox14->Click += gcnew System::EventHandler(this, &Form1::pictureBox14_Click);
    			// 
    			// Form1
    			// 
    			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
    			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
    			this->AutoSize = true;
    			this->BackColor = System::Drawing::SystemColors::ActiveBorder;
    			this->ClientSize = System::Drawing::Size(1018, 741);
    			this->Controls->Add(this->pictureBox14);
    			this->Controls->Add(this->label2);
    			this->Controls->Add(this->numericUpDown2);
    			this->Controls->Add(this->label1);
    			this->Controls->Add(this->numericUpDown1);
    			this->Controls->Add(this->pictureBox12);
    			this->Controls->Add(this->pictureBox11);
    			this->Controls->Add(this->pictureBox10);
    			this->Controls->Add(this->textBox1);
    			this->Controls->Add(this->pictureBox9);
    			this->Controls->Add(this->pictureBox8);
    			this->Controls->Add(this->pictureBox7);
    			this->Controls->Add(this->pictureBox6);
    			this->Controls->Add(this->pictureBox5);
    			this->Controls->Add(this->pictureBox4);
    			this->Controls->Add(this->pictureBox3);
    			this->Controls->Add(this->pictureBox2);
    			this->Controls->Add(this->pictureBox1);
    			this->Controls->Add(this->menuStrip2);
    			this->AllowDrop = true;
    			this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
    			this->Name = L"Form1";
    			this->Text = L"Form1";
    			this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Form1::Form1_FormClosing);
    			this->ResizeEnd += gcnew System::EventHandler(this, &Form1::Resize);
    			this->MouseDown += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::Form1_MouseDown);
    			this->DragEnter += gcnew System::Windows::Forms::DragEventHandler(this, &Form1::Form1_DragEnter);
    			//this->DragDrop += gcnew DragEventHandler( this, &Form1::Form1_Drag);
    			this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox1))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox2))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox3))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox4))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox5))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox6))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox7))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox8))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox9))->EndInit();
    			this->menuStrip2->ResumeLayout(false);
    			this->menuStrip2->PerformLayout();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox10))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox11))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox12))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDown1))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDown2))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->errorProvider1))->EndInit();
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox14))->EndInit();
    			this->ResumeLayout(false);
    			this->PerformLayout();
     
    		}
     
    /////////////////
    //je passe tout les autres évenements inutiles ici
    /////////////////
     
    private: System::Void Form1_DragEnter(System::Object ^  sender,System::Windows::Forms::DragEventArgs ^  e)
    		 {
     
    			 textBox1->Text="ca marche";
     
    		 }
    Et bizarrement, je viens d'essayer de compiler pour récupérer l'erreur, mais en fait plus d'erreur !

    Ce pendant rien ne s'inscrit dans ma picturebox, je m'y connais tres peu en drag and drop, je sais pas si DragEnter est la bonne solution...

    Voila merci de votre aide !

  7. #7
    Rédacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par défaut
    tu peux poster un exemple minimal qui reproduit ton problème ? parce que j'avoue ne pas avoir trop compris ce que tu voulais faire, et qui tu voulais draguer ?

  8. #8
    Membre averti
    Inscrit en
    Mai 2007
    Messages
    45
    Détails du profil
    Informations forums :
    Inscription : Mai 2007
    Messages : 45
    Par défaut
    En fait maintenant je n'ai plus d'erreur lors de la compilation tout marche nickel !

    Pour tester si mon événement marche bien des que je l'execute, j'ai fait ce petit test :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    private: System::Void Form1_DragEnter(System::Object ^  sender,System::Windows::Forms::DragEventArgs ^  e)
    		 {
     
    			 textBox1->Text="ca marche";
     
    		 }
    Mais voila, quand je clique sur ma souris et que je me déplace, rien se passe. Rien d'afficher dans la textbox, et de toute facon quand je met un point d'arret dans ma fonction, je ne passe pas dedans.

    Bref, ce que je voudrais faire ca serait de récupérer les coordonnées de ma souris qui se déplace en temps réel. En fait j'ai crée moi meme une petite scrollbar, et j'aimerai pouvoir y incruster le drag and drop.

    Mais au final je ne sais pas trop quel événement utilisé, peut etre que je pars totalement dans la mauvaise direction avec mon dragenter. Je suis ouvert à toute critique !

    Merci Nico !

  9. #9
    Rédacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par défaut
    ben, moi j'aurai plutot travaillé sur l'événement MouseDown
    avec un boolean qui passe à true quand c'est cliqué, et qui passe à false quand le bouton est relaché.
    Dans l'evenement mouseMove, tant qu'il est appuyé, tu fais ton déplacement

    tiens, il y a un truc dans la faq C++/CLI qui se rapproche de ce que tu veux faire http://dotnet.developpez.com/faq/cpp...ms#MoveControl

  10. #10
    Membre averti
    Inscrit en
    Mai 2007
    Messages
    45
    Détails du profil
    Informations forums :
    Inscription : Mai 2007
    Messages : 45
    Par défaut
    Ecoute tout ce que je peux te dire Nico c'est merci !

    J'utilisais deja l'évenement MouseDown, et quand j'ai commencé à regarder pour le drag and drop je me suis jeté sans réflechir sur l'évenement du meme nom.
    Alors que l'événement MouseMouve était bien plus approprié à mon cas !

    Maintenant ca marche nickel, ton lien m'a bien aidé

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Probleme avec la copie des surfaces
    Par Black_Daimond dans le forum DirectX
    Réponses: 3
    Dernier message: 09/01/2003, 10h33
  2. Problèmes avec le filtrage des ip
    Par berry dans le forum Réseau
    Réponses: 9
    Dernier message: 30/12/2002, 07h51
  3. probleme avec la touche F10
    Par b.grellee dans le forum Langage
    Réponses: 2
    Dernier message: 15/09/2002, 22h04
  4. Probleme avec fseek
    Par Bjorn dans le forum C
    Réponses: 5
    Dernier message: 04/08/2002, 07h17
  5. [Kylix] probleme avec un imagelist
    Par NicoLinux dans le forum EDI
    Réponses: 4
    Dernier message: 08/06/2002, 23h06

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo