What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » C++ Questions (Drag and Drop)

C++ Questions (Drag and Drop)
Author: Message:
leito
Senior Member
****

Avatar
Chameleon by KeyStorm

Posts: 720
Reputation: 5
38 / Male / –
Joined: Apr 2003
O.P. C++ Questions (Drag and Drop)
Hey guys, I'm really sorry of asking another C++ question, but I'm a newbie and need some help from you! For homework, I have to make a Solitaire. I finished, but know I would like to implement Drag and Drop.

I have read a lot of examples in the Internet and Google it, but I only found VB and C# examples. I adapt two and got this C++ code which didn't work:

code:
    private: System::Void pictureBox1_MouseDown(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {
this->pictureBox2->AllowDrop = true;
                                             this->pictureBox1->DoDragDrop(this->pictureBox1->Image, DragDropEffects::Copy);
       
             }
    private: System::Void pictureBox2_DragEnter(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e) {
                 if (e->Data->GetDataPresent(DataFormats::Bitmap))
                     e->Effect = DragDropEffects::Copy;
                 else
                     e->Effect = DragDropEffects::None;
             }
    private: System::Void pictureBox2_DragDrop(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e) {
                 this->pictureBox2->Image = (Image^)e->Data->GetData(DataFormats::Bitmap);
             }


pictureBox1 is the Source pictureBox and pictureBox2 is the Destination pictureBox.

Maybe you could point me out errros, or give me some places to search, and Thanks again.

edit: missing "= true" it works, but I should need better documentations to finish the drag and drop for the solitaire

This post was edited on 10-04-2005 at 03:15 AM by leito.
[Image: leonelgalan.png]
10-04-2005 02:58 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On