Re: Using variables as Objects Name by Stoitcho
Stoitcho
Fri Sep 22 15:58:40 CDT 2006
Roticv,
Just keep im mind that controls my not have name. If they are created in the
designer they always do, but I doubt some one bother giveing names to
controls created by code.
--
Stoitcho Goutsev (100)
"Rotciv" <Rotciv@discussions.microsoft.com> wrote in message
news:47EC6C6F-E05D-45BA-AD60-7FFA42438FF0@microsoft.com...
> Hey all,
>
> Well.. i found the answer, it is as follows
>
> this.Controls[(string)databaseobject("Fieldname")].Visible =
> false;
>
> "Rotciv" wrote:
>
>> Hi all,
>>
>> I am trying to use a variable which retrieves an object name, such as
>>
>> string objObject = databaseobject("Fieldname")
>>
>> and using the objObject to refer to a object, such as a button,
>> textbox
>> or form within the current form and changing stuffs like objObject.text =
>> "blahblahblah".
>>
>> Is this possible? If so, how?
>>
>> thanks.