さてさて、私はドラッグ可能なボーダレスフォームを作成しようとしているC++マイクロソフトのVisual Studio C++ 2010 中に(Winodwsフォームを)簡単な付箋アプリを作ってるんです。私が今持っている コードは次のとおりです。C++ドラッグ可能なボーダレスフォーム
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e)
{
this->dragging = false;
}
private: System::Void Form1_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e)
{
this->dragging = true;
this->offset = Point(e->X, e->Y);
}
private: System::Void Form1_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e)
{
if (this->dragging)
{
Point currentScreenPos = PointToScreen(e->Location);
Location = Point(currentScreenPos.X - this->offset.X, currentScreenPos.Y - this->offset.Y);
}
}
private: System::Void Form1_MouseUp(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e)
{
this->dragging = false;
}
これは私のために動作しません。誰も助けることができますか?
「機能しません」を展開します。 –
MouseMoveイベントで 'e'を使用していません。 –