Setfocus In FlowLayOutPanel Between Controls By Keypress

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maheshwag
    New Member
    • Aug 2010
    • 71

    #1

    Setfocus In FlowLayOutPanel Between Controls By Keypress

    am using C#, VS-2005

    am created runtime controls in flowlayoutpanel my code is below.

    Code:
    [U]First Controls[/U]
    
    TextBox tbb=new TextBox();
    tbb.Name="tbb"+ i.tostring();
    tbb.Location=tbpoint; // tbpoint declare in ClassBody
    tbpoint.Y+=70;
    this.FlowlayoutPanel1.Controls.Add(tbb);
    i++;
    
    [U]Another Control[/U]
    
    TextBox bb=new TextBox();
    bb.Name="bb"+ i.tostring();
    bb.Location=tbbpoint; // tbbpoint declare in ClassBody
    tbbpoint.Y+=70;
    this.FlowlayoutPanel1.Controls.Add(bb);
    i++;
    Both controls are like Row as Below

    Code:
    tbb                                     bb
    Works fine in Flowlayout panel.

    The problem is when user created above controls don't know how much it maybe two or three or maybe more then that. after create controls the cursor move to above flowlay out panel where textbox1 is there. I wants to setfocus on tbb which is created by user after leave textbox1. and then on tbb keypressevent of enter if user perform enter on tbb then focus should be on bb and on and on.

    I don't know how to set focus on created controls in flow layout panel.

    Kindly suggest me proper coding please.

    thx in advance.
Working...