I have a loop that I need to create Entries
dynamically, and with that, I need to setFocus()
on a specifically Entry
, and then, another one, etc.
How can I change the name of variables in runtime to I identify it?
for(i = 0; i < list.Count; i++)
{
//the result that I want:
Entry entry + i = new Entry(){ Placeholder = "Entry number" + i.ToString() };
}
//result
entry1 = /* Placeholder */ "Entry number 1";
entry2 = /* Placeholder */ "Entry number 2";
entry3 = /* Placeholder */ "Entry number 3";
EDIT:
I forgot to put an Entry event that I need to use:
entries[i].Completed += (s, e) =>
{
if (!entries[i].Text.Contains("\u00b2"))
{
entries[i].Text += "\u00b2";
}
};
entries[i].Focus();
when it enters in this event, it can't know how entry that I'm calling, always get the last entry of this array.