How do I convert user input, into a textbox to hex? This is my first windows program. I realize I have a lot to learn and this is probably over my head but would like to finish my program. It is not homework, it's just something that could be a little useful at my job. Here is the code for my caculate button:
I need to convert textboxes 1, 2 4 and 5 to hex to get the calculation right. Do I do that from here or can I specify in the textbox code, which I haven't touched?Code:#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
int start_cyl = System::Int32::Parse(textBox1->Text);
int end_cyl = System::Int32::Parse(textBox2->Text);
int start_head = System::Int32::Parse(textBox4->Text);
int end_head = System::Int32::Parse(textBox5->Text);
int ans = (start_cyl * 0x80 * 0xf) + (start_head * 0x80);
int ans1 = (end_cyl * 0x80 * 0xf) + (end_head * 0x80);
textBox6->Text = ans.ToString();
textBox3->Text = ans1.ToString();
Any help would be appreciated.