Windows Form Application muhitida yangi loyiha yaratiladi. Formaga
bitta Button komponеntasi joylashtiriladi. Dastur kodlari quyidagicha:
1.
#pragma endregion
2.
bool Pеrеmеhеniе;
3.
int MouseDownX; int MouseDownY;
4.
private: System::Void Form1_Load(System::Object^ sender,
5.
System::EventArgs^ e) { Pеrеmеhеniе = false;}
6.
private: System::Void button1_MouseDown(System::Object^ sender,
7.
System::Windows::Forms::MouseEventArgs^ e) { if (e->Button ==
8.
System::Windows::Forms::
9.
MouseButtons::Left) { Pеrеmеhеniе = true; MouseDownX = e->X;
10.
MouseDownY = e->Y; } }
11.
private: System::Void button1_MouseUp(System::Object^
Do'stlaringiz bilan baham: |