|
This is the C++/CLI forum; which are you using, C++/CLI or unmanaged C++?
Use the best guess
|
|
|
|
|
I have no idea.
Thought I could get some help here ?
|
|
|
|
|
Søren Lyder Nielsen wrote: I have no idea. Seriously? You are writing a program and you do not know what language or framework you are using? I don't know how you expect us to help if you cannot answer such a basic question. I would suggest you make a decision which language you plan to use and get hold of a book to learn the basics of it before trying anything else.
Use the best guess
|
|
|
|
|
Thanks for the help.
But i gotta say, I feel it a is waste of time to try and get anything usefull out of you.
All I ask for, is that you write one line of code with my own data in C++. But instead i feel you blame me for not knowing anything, even though that was one of the first things i told you.
I will try my luck some other time.
|
|
|
|
|
Søren Lyder Nielsen wrote: All I ask for, is that you write one line of code with my own data in C++. No, you have not asked that, you asked how to get a number formatted in a particular way in C++/CLI, and I referred you to the documentation that explains it in detail, with plenty of samples. It seems you are not prepared to spend the time reading it. You also do not seem to know exactly which language you are using, so I cannot answer the question, because it would be different for each language.
Søren Lyder Nielsen wrote: But instead i feel you blame me for not knowing anything Neither did I blame you for anything. I have done my best to help you but I cannot answer the question unless I get the proper facts to start with. As I said before, you need to decide which version of the language you are using and start studying it. Give us the proper facts and background to your problem and we will try to help, but you are expected to do some of the work for yourself.
Use the best guess
|
|
|
|
|
1 - convert them to float type , example :
{
double a = 2.1589687489;
String^ b = Convert::ToString((float)a);
}
2 - remove them , example :
{
double a = 2.1589687489;
String^ b = Convert::ToString(a);
b = b->remove(b->IndexOf('.')+2 );
}
|
|
|
|
|
There is no need to do that when you can use format strings to produce the required result in the first place.
Use the best guess
|
|
|
|
|
this is my code in windows form.... it compiles without error but it prints blank page.... where i done wrong?? please help...
#pragma endregion
private: System::Void Button1_Click_1(System::Object^ sender, System::EventArgs^ e) {
PrintDialog1->AllowSomePages = true;
PrintDialog1->ShowHelp = true;
PrintDocument ^docToPrint = gcnew PrintDocument;
PrintDialog1->Document = docToPrint;
if ( docToPrint == nullptr )
System::Windows::Forms::MessageBox::Show( "null" );
if ( PrintDialog1 == nullptr )
System::Windows::Forms::MessageBox::Show( "pnull" );
System::Windows::Forms::DialogResult result = PrintDialog1->ShowDialog();
System::Windows::Forms::MessageBox::Show( result.ToString() );
if ( result == System::Windows::Forms::DialogResult::OK )
{
docToPrint->Print();
}
}
private: System::Void document_PrintPage_1(System::Object^ sender, System::Drawing::Printing::PrintPageEventArgs^ e) {
String^ text = "In document_PrintPage method.";
System::Drawing::Font^ printFont = gcnew System::Drawing::Font( "Times New Roman",20,System::Drawing::FontStyle::Bold );
e->Graphics->DrawString("EAK TEAM TEST!!!",printFont,Brushes::Black,50,50);
e->Graphics->DrawString( text, printFont, System::Drawing::Brushes::Black, 10, 10 );
}
|
|
|
|
|
You have already asked this in QA. Please do not cross post.
|
|
|
|
|
yes .. but i didnt get an answer... and this is very very important to me...
"The more quieter you become, the more you are able to hear..."
|
|
|
|
|
eakteam wrote: very very important to me
So? That is no reason to rudely post this over and over.
|
|
|
|
|
ok i see ur disturbing... im sorry. nobody born with c++ LANGUAGE knowledge.. u too, like me was amateur....
"The more quieter you become, the more you are able to hear..."
|
|
|
|
|
Okaaaaaaaaaaaay what exactly does that have to do with anything? Knowing C++ is not a prerequisite to following the forum posting guidelines or for having some manners.
|
|
|
|
|
|
i dont see any tutorial for c++ windows form???? please help
"The more quieter you become, the more you are able to hear..."
|
|
|
|
|
You will have to look at the C# and VB.NET samples and adapt your code from them, as they all use the same .NET framework.
Use the best guess
|
|
|
|
|
ok i will see harder... thank you
"The more quieter you become, the more you are able to hear..."
|
|
|
|
|
I Get this error, when I write a number in my textBox1, and then erase it again.. Then this popup appers:
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: Input string was not in a correct format.
Code:
private: System::Void textBox1_TextChanged(System::Object^ sender, System::EventArgs^ e) {
double tysk, ti, femten, tyve, dansk;
tysk = System::Convert::ToDouble(textBox1->Text);
dansk = tysk * 7.5;
ti = tysk * 7.5 * 0.90;
femten = tysk * 7.5 * 0.85;
tyve = tysk * 7.5* 0.80;
label7->Text = System::Convert::ToString(dansk);
label8->Text = System::Convert::ToString(ti);
label9->Text = System::Convert::ToString(femten);
label10->Text = System::Convert::ToString(tyve);
}
};
It also appers when I type a letter in the teksBox1.
Otherwise it workd fine.
Its just a simlpe calculator.
|
|
|
|
|
tysk = System::Convert::ToDouble(textBox1->Text);
This will always throw an exception if the contents of teksBox1 is not a number. You should either catch the exception and deal with it, or use the TryParse [^] method.
Use the best guess
|
|
|
|
|
Look this Example .. it will help.
int a= Convert::ToInt32(this->textBox1->Text->Trim());
int b= Convert::ToInt32(this->textBox2->Text->Trim());
int sum=a+b;
"The more quieter you become, the more you are able to hear..."
|
|
|
|
|
Use this instead of "Convert::ToString()" function
int a = 287;
String ^b = "";
b += a;
|
|
|
|
|
Hello Everyone... Im New User and i have a big problem in my c++ clr windows for application application... So : i want to print to the printer a string or something else.. for example i want to print to the printer this string : String ^ test="This is printing test!"; or i want to print what a user type into text box for example : this->textBox1->text;
so, before printing in the paper i want to show dialog box to select what printer i want to use, and then start printing..... i want really really some help.. i search in google and everything but nothing explaining well... so i choose to come in cedoproject bcos i think its the best place.... please help me .. thank you so much... sorry for my low english ....
|
|
|
|
|
|
Thank You so much, but the msdn tutorial its throw me exception "Object Reference not set to an instance of an object" and not printing... aand code project tutorial its not c++ Windows form application, i think its c# .net.
please help me if u can with your tutorial for c++ windows form...... thank you..
<pre lang="text">
modified 15-Apr-13 6:16am.
|
|
|
|
|
eakteam wrote: Object Reference not set to an instance of an object Means you are using an object reference that has not been initialised; use your debugger to find out where, what and why. As to the rest, whether it is C#, VB.NET or C++/CLR, the basics are the same and the code samples in MSDN are given in all languages.
Use the best guess
|
|
|
|