This is a migrated thread and some comments may be shown as answers.

Get Dinamyc a Control and convert to label or text

0 Answers 16 Views
Telerik Trainer
This is a migrated thread and some comments may be shown as answers.
RM04550
Top achievements
Rank 1
RM04550 asked on 20 Mar 2014, 06:11 PM

How I change dinamyc a control that get by this.Controls.FindAll() in Label or Text by variables for example I have
or get all controls and set the tooltips to all, I have something like this: 

IEnumerable<Control> controlesEntrada = this.Controls.FindAll();
foreach (Control control in controlesEntrada)
{
   c = control.GetType();
   myelement = c.Name; //Get the string "Label" in this variable

    //How I do this:
     Label milabel = (Label)myelement;
    // with the variable
     myelement milabel (myelement)myelement
}
this dont permit because string to control cant... how I can be?




   
c9.Tooltip = "Este es tu label";

No answers yet. Maybe you can help?

Tags
Telerik Trainer
Asked by
RM04550
Top achievements
Rank 1
Share this question
or