Windows Forms - Black Scholes Calculator Trouble

Pages: 12
Ok,this has no error trapping in it.
right click on your project and add new ui. add a windows form and call it inputForm
in your inputForm add two buttons change text on button1 to cancel and button2 to submit
add 4 textboxes and 4 labels. arrange them so label1 corresponds to textbox1 etc. this is where they will input their rate, volume etc...
on your form1 #include "inputForm.h"
on your inputForm make the textboxes all public like so (just change the private to public)
1
2
3
4
public: System::Windows::Forms::TextBox^  textBox1;
	public: System::Windows::Forms::TextBox^  textBox2;
	public: System::Windows::Forms::TextBox^  textBox3;
	public: System::Windows::Forms::TextBox^  textBox4;


go to your inputform button2 design view and change property of dialogresult to OK
in your form1.buttonclick event do this
1
2
3
4
5
6
7
 inputForm^ inf = gcnew inputForm();
				 inf->ShowDialog();
				 if(inf->button2->DialogResult == Windows::Forms::DialogResult::OK)
				 {
					 dblRate = Double::Parse(inf->textBox1->Text);
					 MessageBox::Show(dblRate.ToString());
				 }


you will need to add the others and post any issues/questions you have. that should get you started
Why not just ask your professor?
Topic archived. No new replies allowed.
Pages: 12