I have used following code written in OfferKeyEvent to type in to two CEikEdwin textboxes i have placed on the screen. And it is working. But this code will be inefficient if number of text boxes increases. Please help me by suggesting a better idea of handling text box focuses.

TKeyResponse CmyProContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
{

if (aType == EEventKey)
{
if(aKeyEvent.iScanCode == EStdKeyDownArrow)
{
iText1->SetFocus( EFalse );
iText2->SetFocus( ETrue );
}
if(aKeyEvent.iScanCode == EStdKeyDownArrow)
{
iText1->SetFocus( ETrue );
iText2->SetFocus( EFalse );
}
}

if (iText1->IsFocused())
return iText1->OfferKeyEventL(aKeyEvent, aType);
else if (iText2->IsFocused())
return iText2->OfferKeyEventL(aKeyEvent, aType);
else
return CCoeControl::OfferKeyEventL(aKeyEvent, aType);
}