Best way to obtain user input from GUI and pass to function (C++/CLI)? -


i've been working on console application on 2 years, , although code being improved/extended, thought helpful add gui it. after initial stumbling blocks, have basic gui (windows forms using cli). initially, tried input gui within "main" function (it main function console app). read not idea, , realised don't want input function potentially change after click "run" button.

so basically, i'm wondering best programming practice this. way know how open "main" function within button_click event, , pass values obtained textboxes , checkboxes it.

i'm not aware of way, seems way sloppy. there potentially on 100 values passed main function, , i've never seen function many arguments. in past, hardcoded them function, or used cin alter them @ runtime.

any advice on appreciated. don't want continue doing i'm doing if it's poor programming practice. should mention programming style procedural, don't have knowledge of oop.

here example illustrate how i'm doing @ moment:

private: system::void button1_click(system::object^  sender, system::eventargs^  e) {     if ( this->input1->text->length == 0 )          this->input1->text = "enter number";     else{         string^ in1str = this->input1->text;         double in1 = convert::todouble(in1str);         if(this->cbshowconsole->checked)             showconsole();         main(in1);     } } 

so, reiterate, way here, input2, input3, input4, etc., , pass in2, in3, in4, etc. main function.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -