>>>>
>>>>The key word is in bold...why take the chance?
>>Or, put another way, what specific requirement do you have that is best overcome by a public variable?
>
>In projects where I hard-code the form GUI's, it seems (that) runtime won't recognize them unless the name is declared public. I try not to do it, but runtime hiccups - and then I have to.
>
Terry,
I understand the problem. It sounds like you want to have a variable that is visible in various places in the form.
There are at least 2 ways to catch this fox:
1) Use custom properties of the form to hold these values. You could even have a property on the form hold an object reference. Inside of that object, you could have several properties (which act like variables). This object would then be visible everywhere within the form.
2) Or, if you need something that is accessible across multiple forms, use an object (or variable) that is created in the main program (before the forms are launched. Make this object a private variable.
HTH,
Steve Gibson