windows form



Автор Геннадий Хмелевцов задал вопрос в разделе Другие языки и технологии

помогите пожалуйста!!)) visual studio c++ windows form и получил лучший ответ

Ответ от Вадим Сытник[гуру]
Если координатную сетку так просто разрисуй линии и все. public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); x1=-1; y1=-1; g = this->CreateGraphics(); blackPen=gcnew Pen(this->ForeColor,2) ; // //TODO: Add the constructor code here // } protected: /// <summary> /// Clean up any resources being used. /// </summary> ~Form1() { delete blackPen; delete g; if (components) { delete components; } } private: int x1,x2,y1,y2; Graphics ^ g; Pen^ blackPen; /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> void InitializeComponent(void) { this->SuspendLayout(); // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->BackColor = System::Drawing::SystemColors::Info; this->ClientSize = System::Drawing::Size(292, 273); this->Name = L"Form1"; this->Text = L"Form1"; this->MouseDown += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::Form1_MouseDown); this->ResumeLayout(false); } #pragma endregion private: System::Void Form1_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { ::System::Windows::Forms::MouseButtons; if(e->Button ==::System::Windows::Forms::MouseButtons::Left ) if((x1==-1)&&(y1==-1)) { x1=e->X; y1=e->Y; } else { x2=e->X; y2=e->Y; g->DrawLine(blackPen,x1,y1,x2,y2); x1=-1; y1=-1; } } }; }

Ответ от 3 ответа[гуру]
Привет! Вот подборка тем с похожими вопросами и ответами на Ваш вопрос: помогите пожалуйста!!)) visual studio c++ windows form
Windows Forms на Википедии
Посмотрите статью на википедии про Windows Forms
 

Ответить на вопрос:

Имя*

E-mail:*

Текст ответа:*
Проверочный код(введите 22):*