| View previous topic :: View next topic |
| Author |
Message |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Wed Aug 15, 2007 6:05 pm Post subject: 3 Questions [C++] |
|
|
1st Question:
Solved
2nd Question:
I wanna try sending Keys to the textBox (same one as above)
I know i have to use GetAsyncKeyState, problem is im not sure which Event Handler To use... or should i try adding it to the source file.
i know its supposed to be (example of what im trying to put)
| Code: | if (GetAsyncKeySate(VK_NUMPAD0))
{
textBox1->Focus();
textBox1->Text = textBox1->Text+"0";
} |
Error's Getting:
| Code: | 1>c:\documents and settings\kyle h\my documents\visual studio 2005\projects\exe\exe\Form1.h(490) : error C2059: syntax error : 'if'
1>c:\documents and settings\kyle h\my documents\visual studio 2005\projects\exe\exe\Form1.h(491) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body |
3rd Question
In Managed C++, How Do I open a new form from a menu button or button?
Help is greatly appreciated.
I've searched for all of these btw.
_________________
Last edited by lurc on Wed Aug 15, 2007 9:27 pm; edited 1 time in total |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Aug 15, 2007 8:08 pm Post subject: |
|
|
1. Convert::ToSingle, Convert::ToString
2. Maybe try overrideing ProcessCmdKey?
3. Form2^ dongs = gcnew Form2;
dongs->Show();
i think.
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Wed Aug 15, 2007 8:18 pm Post subject: |
|
|
thanks, ill try that
Edit:
Convert::ToSingle and ToString Work great thanks!
Edit 2:
new Form code didnt work
Error:
| Code: | 1>c:\documents and settings\kyle h\my documents\visual studio 2005\projects\exe\exe\Form1.h(421) : error C2065: 'frmAbout' : undeclared identifier
1>c:\documents and settings\kyle h\my documents\visual studio 2005\projects\exe\exe\Form1.h(421) : error C2065: 'dongs' : undeclared identifier
1>c:\documents and settings\kyle h\my documents\visual studio 2005\projects\exe\exe\Form1.h(421) : error C2061: syntax error : identifier 'frmAbout'
1>c:\documents and settings\kyle h\my documents\visual studio 2005\projects\exe\exe\Form1.h(422) : error C2227: left of '->Show' must point to class/struct/union/generic type |
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Aug 15, 2007 8:55 pm Post subject: |
|
|
| I've never done it before, so I was just taking a guess. Anyway, apparently in managed C++ you can't call a form directly from another form like you can in C#. You'll have to look this one up, since I don't know how to do it.
|
|
| Back to top |
|
 |
|