Capturing KeyUp and Setting Value ...
-
Hello, I am currently trying to change from VB .Net to VC++ .Net. I am trying to take information from a KeyUp event in the main form (form1), and put the KeyData into
label1->Text
. Here is my code:private: System::Void Form1_KeyUp(System::Object * sender, System::Windows::Forms::KeyEventArgs * e)
{
label1->Text = e->KeyData;
}However, it returns me the error saying that "c:\...\TestingC++\Form1.h(96): error C2664: 'System::Windows::Forms::Control::set_Text' : cannot convert parameter 1 from 'System::Windows::Forms::Keys' to 'System::String __gc *'" What should I do to correct this error? Any help will be greatly appreciated, Programmer2k4 My sig: "And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright I now use my CodeProject Blog! Most recent blog post: March 24
-
Hello, I am currently trying to change from VB .Net to VC++ .Net. I am trying to take information from a KeyUp event in the main form (form1), and put the KeyData into
label1->Text
. Here is my code:private: System::Void Form1_KeyUp(System::Object * sender, System::Windows::Forms::KeyEventArgs * e)
{
label1->Text = e->KeyData;
}However, it returns me the error saying that "c:\...\TestingC++\Form1.h(96): error C2664: 'System::Windows::Forms::Control::set_Text' : cannot convert parameter 1 from 'System::Windows::Forms::Keys' to 'System::String __gc *'" What should I do to correct this error? Any help will be greatly appreciated, Programmer2k4 My sig: "And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright I now use my CodeProject Blog! Most recent blog post: March 24
That is because the KeyValue return int. [C++] public: __property int get_KeyValue(); Sonork 100.41263:Anthony_Yio