incrementing via timer and loading value to text box
-
Hi, To pry my way into C++ graphics programming I'm trying to start simple. I'm just trying to get a textbox to increment every time a timer event (tick) occurs. In a nutshell, I'm calling a function which increments a 'public' (form-wide) variable and then trying to read that value into a textbox. The problem I'm having is that the type is mismatched and I can't seem to get the textbox to accept the value. The .NET Framework Class Library says you can use this class: public __gc __sealed class Convert however, despite their examples which show the use of one argument, it claims that it wants something other than 1 argument (says "does not contain 1 argument"). Not sure how to use this, if indeed that is what I should be using. Any suggestions would be appreciated. Thanks, Jeff
-
Hi, To pry my way into C++ graphics programming I'm trying to start simple. I'm just trying to get a textbox to increment every time a timer event (tick) occurs. In a nutshell, I'm calling a function which increments a 'public' (form-wide) variable and then trying to read that value into a textbox. The problem I'm having is that the type is mismatched and I can't seem to get the textbox to accept the value. The .NET Framework Class Library says you can use this class: public __gc __sealed class Convert however, despite their examples which show the use of one argument, it claims that it wants something other than 1 argument (says "does not contain 1 argument"). Not sure how to use this, if indeed that is what I should be using. Any suggestions would be appreciated. Thanks, Jeff
Can you show your code? From the description you provide it appears that there is a mismatch in the parameters you use for the function call.
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
-
Hi, To pry my way into C++ graphics programming I'm trying to start simple. I'm just trying to get a textbox to increment every time a timer event (tick) occurs. In a nutshell, I'm calling a function which increments a 'public' (form-wide) variable and then trying to read that value into a textbox. The problem I'm having is that the type is mismatched and I can't seem to get the textbox to accept the value. The .NET Framework Class Library says you can use this class: public __gc __sealed class Convert however, despite their examples which show the use of one argument, it claims that it wants something other than 1 argument (says "does not contain 1 argument"). Not sure how to use this, if indeed that is what I should be using. Any suggestions would be appreciated. Thanks, Jeff
it would be better if you post your Managed C++ question in it's relevent column http://www.codeproject.com/script/Forums/View.aspx?fid=3785[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
it would be better if you post your Managed C++ question in it's relevent column http://www.codeproject.com/script/Forums/View.aspx?fid=3785[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
Hi, Okay this is the simplest expression:
private: System::Void timer1_Tick(System::Object * sender, System::EventArgs * e)
{
timerVal++;
textBox1->Text = timerVal;
}This didn't work. I tried using the aforementioned class pretty much as shown in the example, and that gave me the message about an incorrect number of arguments. This is surprisingly hard to find information on. ___ Alok: I noticed that other code category which might be more relevant. I felt the questions there seemed more advanced. I'm not averse to someone moving it if they think this is improperly placed. Thanks, Jeff
-
Hi, Okay this is the simplest expression:
private: System::Void timer1_Tick(System::Object * sender, System::EventArgs * e)
{
timerVal++;
textBox1->Text = timerVal;
}This didn't work. I tried using the aforementioned class pretty much as shown in the example, and that gave me the message about an incorrect number of arguments. This is surprisingly hard to find information on. ___ Alok: I noticed that other code category which might be more relevant. I felt the questions there seemed more advanced. I'm not averse to someone moving it if they think this is improperly placed. Thanks, Jeff
Jeffrey Webster wrote:
Alok: I noticed that other code category which might be more relevant. I felt the questions there seemed more advanced. I'm not averse to someone moving it if they think this is improperly placed.
No offence, actually this forum is dedicated to unmanaged vc++, very few people gradute to managed vc++ from unmanaged vc++. So, chances of finding a managed vc++ guy on unmanaged vc++ forum is less compared to managed vc++ forum.So just to help you, I mentioned it would be better if you post your query in appropiate forum. Regarding moving your post, i don't haev authority to do so.. might be some from CP Staff can do it
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
Hi, Okay this is the simplest expression:
private: System::Void timer1_Tick(System::Object * sender, System::EventArgs * e)
{
timerVal++;
textBox1->Text = timerVal;
}This didn't work. I tried using the aforementioned class pretty much as shown in the example, and that gave me the message about an incorrect number of arguments. This is surprisingly hard to find information on. ___ Alok: I noticed that other code category which might be more relevant. I felt the questions there seemed more advanced. I'm not averse to someone moving it if they think this is improperly placed. Thanks, Jeff
You could try
textBox1->Text = timerVal.ToString();
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
You could try
textBox1->Text = timerVal.ToString();
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
Hi, Thanks, that worked. Jeff
-
Jeffrey Webster wrote:
Alok: I noticed that other code category which might be more relevant. I felt the questions there seemed more advanced. I'm not averse to someone moving it if they think this is improperly placed.
No offence, actually this forum is dedicated to unmanaged vc++, very few people gradute to managed vc++ from unmanaged vc++. So, chances of finding a managed vc++ guy on unmanaged vc++ forum is less compared to managed vc++ forum.So just to help you, I mentioned it would be better if you post your query in appropiate forum. Regarding moving your post, i don't haev authority to do so.. might be some from CP Staff can do it
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
Hi Alok, I did actually post another question on the Managed C++ board. I'll use this board only if it's specifically a C++ question. Thanks, Jeff