I think there it is: http://msdn.microsoft.com/cs-cz/beginner/bb308760(en-us).aspx
Polar_Sheep
Posts
-
Please Guide Connect Sqlserver with VC++6.0. thanks very much -
Multiple FormsOh, thank you for your help. I was googling with "c++\cli" AND "#include"Form2.h"" and I found solution. It was that what you wrote. Same name Form2. THANK YOU
modified on Sunday, August 24, 2008 1:43 PM
-
Multiple FormsThank you, it works, but there is still little problem.
Form1::Visible = false; // I must create Form2, how can I do that? // Cannot use System::Windows::Forms::Form^ Form2 = gcnew System::Windows::Forms::Form; // It will be new form, but I need my Form2 Form2->Show(); // non-static member, I must use ->
-
Multiple FormsSure, but I cant use (in example) in Form1 -> Form1.Visible = true; OK Form2.Show = true; it doesnt know Form2 (I maybe use :: ) I must include something to Form1?
-
Multiple FormsHi, I need use two forms in application. Is some easy way exists? I do that in Delphi, but in C++/CLI Win Form app is something understandable. I was googling for some easy practise, but not found it. Is there something who help me with piece of code for two forms?
-
Event on KeyPressthis->textBox1->KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &Form1::textBox1_KeyDown); :-D Thank you very much and sorry for your time
-
Event on KeyPress'void PoHavarii::Form1::textBox1_KeyDown(System::Object ^,System::Windows::Forms::KeyEventArgs ^)' : the specified function does not match the delegate type 'void (System::Object ^,System::EventArgs ^)' It needs other function, but we are on the right way :) Many thanks
-
Event on KeyPress#pragma once namespace PoHavarii { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); } protected: ~Form1() { if (components) { delete components; } } private: System::Windows::Forms::TextBox^ textBox1; protected: private: System::Windows::Forms::TextBox^ textBox2; private: System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code void InitializeComponent(void) { this->textBox1 = (gcnew System::Windows::Forms::TextBox()); this->textBox2 = (gcnew System::Windows::Forms::TextBox()); this->SuspendLayout(); // // textBox1 // this->textBox1->AcceptsReturn = true; this->textBox1->Location = System::Drawing::Point(108, 55); this->textBox1->Name = L"textBox1"; this->textBox1->Size = System::Drawing::Size(181, 20); this->textBox1->TabIndex = 0; // // textBox2 // this->textBox2->Location = System::Drawing::Point(108, 94); this->textBox2->Name = L"textBox2"; this->textBox2->Size = System::Drawing::Size(181, 20); this->textBox2->TabIndex = 1; // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(391, 264); this->Controls->Add(this->textBox2); this->Controls->Add(this->textBox1); this->KeyPreview = true; this->Name = L"Form1"; this->Text = L"Form1"; this->ResumeLayout(false); this->PerformLayout(); } #pragma endregion void textBox1_KeyDown( Object^ /*sender*/, System::Windows::Forms::KeyEventArgs^ e ) { if ( e->KeyCode == Keys::Enter) textBox2->Text = L"Enter was pressed"; } }; }
-
Event on KeyPressAcceptsReturn True... Still is not work. Shall I have some code in Initialize component? I mean something like this: this->textBox1->KeyDown = gcnew... something?
-
Event on KeyPressThanks, but I still not work. I have this: void textBox1_KeyDown( Object^ /*sender*/, System::Windows::Forms::KeyEventArgs^ e ) { if ( e->KeyCode == Keys::Enter) textBox2->Text = "Enter was pressed"; }
-
Event on KeyPressHi guys, I have a problem with event on key press enter. I have a TextBox1, then I am a typing to him and I need to if KeyPress was ENTER call my function Result(). I think I can not do something function like that:
void textBox1_KeyPress( Object^ /*sender*/, System::Windows::Forms::KeyPressEventArgs^ e ) { if(e->KeyCode == Key::Enter) // if press key is enter Result(); // my function }
I am looking for some pieces of code in msdn, but I still have a problem somewhere. KeyPreview in Properties Form1 is true. I am so sorry for this stupid question :( -
group of buttonstextBox1->AppendText(this->ActiveControl->Text); Yipee! Fairness still exists :) Thank you so much
modified on Sunday, July 6, 2008 4:40 PM
-
group of buttonsprivate: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { textBox1->AppendText(System::Windows::Forms::ButtonBase::Text); } I do this code, but it still needs System::Windows::Forms::ButtonBase::Text as a static. I think I follow your definition - you can say that in values sender and e is everything what can we need.
-
group of buttonscan you write it in code please?
-
group of buttonsThank you, it works. But I have got still one little problem. I need take Button1->Text, ..., Button10->Text so I have something like that private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { textBox1->AppendText(
buttonX
->Text); } How to change X? -
Visual c++ NET Application ProblemeInstall Visual Studio Redistributable, and you must click on properties of your project -> Configuration properties and Configuration change from DEBUG to RELEASE. I must install .NET framework 3.5 to another computer. It is working on Vista, under XP It dont works.
-
group of buttonsCan you write that in code please? I need something like this to more powerful code: NOW: private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { } private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { } ... Future something like this: button 1-10_Click
-
group of buttonsHi, I have a project with 2 groups of buttons and I need assign to event on click to 1 group same piece of code and to 2 group another code. Solving it some component like GroupBox or someone?
-
sample projectEverything you need to know is this (for VS 2008): File -> New -> Project then look for Windows Form Application click to Form1.h, you can see Form1.h [Design] and you can place some components from Toolbox there. In Properties are the characters of components.