Jump to content

automatic TextBox-Value interface

- - - - -

  • Please log in to reply
No replies to this topic

#1
anotheruser

anotheruser

    Learning Programmer

  • Members
  • PipPipPip
  • 44 posts
I'm writing a simulation for school that simulates the trajectory of a ball.

It has a lot of parameters and as of now, I have to provide
-a TextBox to enter the value
-a variable to store the value,
-a way to translate user input into a value (e.g. "123" as a string-->123 as an integer)
-a way to update the TextBox if the simulation changes the value internally
-a way to signal that the entered value is invalid and
-a method that defines what to do if that is the case (like diabling the start button if start parameters are invalid)
for every single one of the values. As I want to use this program to get into University (practical experience is never wrong), I want it to encompass a lot of different parameters to show them that I know what I'm doing.

Now my question: is there any way to make this easier/faster? Is there a pre-existing template to link a variable with a TextBox or another Form? If not, do you have any suggestions how I could code one myself? I have a few ideas but there are some difficulties with each of them as there doesn't seem to be a common class that all Forms share (at least I can't find any), so I'd have to use switch statements to specify what to do for each of the different Forms. They all have a field called "Text", but no common base class that has that field.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users