New to windows forms so please bear with me.
I have a simple application that displays a few buttons, and I'd like the attributes of these buttons to be set by the user using some kind of external config file e.g. config.ini.
In the config file, the attributes would be set out something like this:
[Button 1] //button identifier
isEnabled = True //show/hide the button
colour = "#FFFF" //button background colour
caption = "Button" //text to display on button
action = "Action" //action when button is clicked
The config file should be stored with the program executable, and when the program is launched, it will display the buttons and text defined in this file.
The action determines what happens when the button is clicked. This could either be opening a new page, or writing a string to a variable. The aim of the program is to allow users to navigate through a couple of menus, and then select a button which will print out the string.
Edit: if the action is to go to a new page, it will just say 'Next Page' so I guess I can just use an if/else for this. I.E.
if(string.Equals("Next Page"){
//go to next page
} else{
//save string to variable
}
I know how to set button attributes in the code, but I don't understand how I can read the config file. Its important that these attributes can be set from the external file so that the program can be easily configured without needing to rebuild it.