From UI to GUI (WinForms)

Basically I'm moving a program form Console interaction to Graphic interface. I know how to work with WinForms but I'm stuck on moving the code cause in the UI, all the functions were returning whatever I wanted but this time I have to make buttons and eventhandlers and I have absolutely no idea how to return the final "program"

Code of the UI: http://ift.tt/1QVYCep

Explanation: It's the UI for a supposedly ToyLanguage. The user chooses what statements to add (only from the predefined ones), the only thing the user has liberty to do is to input values. Each function will call another and so on until the user completed the program.

How can I do this using buttons? So far I made 2 menu's and I'm stuck. MainMenu and Statement Menu but nowhere to go from here cause I have no idea how to form the final statement sincle eventhandler can't return values so just making eventhandlers for clicked buttons is pointless.

Any ideas?

by LisaFortitude via /r/csharp

Leave a Reply