I am currently developing an application where the user name field is the name of his choice. This will allow you to customize the interface and thus make it more user friendly)
To do this:
I asked a series of TextBox (12) with a label attached to each TextBox on a form of configuration
I edit a line of code to use the name of the label if the TextBox is empty.
I gave the possibility to lock or unlock the TextBox to prevent accidental changes
I created a file "Config.txt" to save the contents of my textBox
I write code that can write to this file. Each data is separated by a comma.
I wrote the code to read this file. It is able to separate the data between 2 commas
This file will be read at the opening of the application and inform the labels associated with objects.
So much for principle.
For practice, I have yet to create a new variable containing the names of objects (TextBox contents of my Form Configuration). The content of these variables will be written in my file config.txt.
But in your opinion, what is preferable, using a variable for each TextBox or creating a table containing all the names of all my TextBox? In terms of writing this does not change much. But is it better to declare 12 String variables or a array containing 12 String ? When should I use a table rather than independent variables?
Bookmarks