Page 1 of 1

Populate an Edit Box from a variable

Posted: Fri Apr 21, 2006 3:34 pm
by Guest
I have a custom dialog that lets the user set some variables that get written to an ini file for startup.

Sometimes it is necessary to do a maintenance install (add/remove components). If the user had originally installed this component, and leaves it installed, I want that custom dialog to be populated with the values from the ini file. I can read the values from the ini just fine.

How can I get the edit box to be populated with the variable's value?

Posted: Fri Apr 21, 2006 4:52 pm
by jimo
Try using a standard label with a variable say $INIVALUES$ for the caption property then when reading in the values assign them to the INIVALUES variable like
Set Variable INIVALUES to $INIVALUES$$NEWLINE$$VALUE1FROMINI$
etc, etc.

Posted: Fri Apr 21, 2006 5:20 pm
by Guest
I would still like to let them change it, however. The main value they set is for an IP address. If they are changing components then they are likely to be changing what server they want to talk to.

From your response it appears that the best I can do is display the old value and let them enter a new one if they would like. I can think how to make that work but for one other problem: Is there a way to change the visibility of a dialog component based on a variable?

Posted: Sat Apr 22, 2006 4:57 am
by MichaelNesmith
Yes - just put a label on the form and set its caption to $VAR$, this way you can easily use that label's caption property in the rules editor.