H
Ich habs jetzt hinbekommen und falls es jemand interessiert, hier mal der Sourcecode:
(Form ohne Titelleiste verschieben)
//
// Form1
//
resources->ApplyResources(this, L"$this");
this->AccessibleRole = System::Windows::Forms::AccessibleRole::None;
this->AllowDrop = true;
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->AutoValidate = System::Windows::Forms::AutoValidate::Disable;
this->BackColor = System::Drawing::Color::Fuchsia;
this->CausesValidation = false;
this->Controls->Add(this->checkBox1);
this->Controls->Add(this->button1);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->comboBox2);
this->Controls->Add(this->comboBox1);
this->Controls->Add(this->FormVisibleTag);
this->DoubleBuffered = true;
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
this->KeyPreview = true;
this->MaximizeBox = false;
this->MinimizeBox = false;
this->Name = L"Form1";
this->ShowInTaskbar = false;
this->TransparencyKey = System::Drawing::Color::Fuchsia;
//Hier die Beiden wichtigen definitionen:
this->MouseUp += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::Form1_myMouseUp);
this->MouseDown += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::Form1_myMouseDown);
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->contextMenuStrip1->ResumeLayout(false);
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void Form1_myMouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e){
this->Location::set(Point((this->MousePosition.X - MouseMovePosBufferX), (this->MousePosition.Y - MouseMovePosBufferY)));
}
private: System::Void Form1_myMouseUp(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e){
this->MouseMove::remove(gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::Form1_myMouseMove));
}
private: System::Void Form1_myMouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e){
this->MouseMovePosBufferX = e->X;
this->MouseMovePosBufferY = e->Y;
this->MouseMove += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::Form1_myMouseMove);
}