Vital wrote:Hello,
You can use following code from your application:
report.GetComponentByName("txtHeader1").Enabled = false;
Thank you.
I'm sorry if I didn't make myself clear.
What I am trying to do is to disable all controls (in my case I have 20 text controls)
using a
for loop
It took time for me to figure it out
and here's what I did to make it work
Code: Select all
int intIndex = 0;
for(int ctr=1; ctr<=20; ctr++){
intIndex = ctr;
string index = intIndex.ToString();
string controlname = "txtHeader"+intIndex;
StiText text = new StiText();
text = GetComponentByName(controlname) as StiText;
text.Enabled = false;
}
and fortunately, it worked!
my only problem now is how to convert this into a reusable function
Any Advise?
Great Thanks!