c# - TabIndex for dynamically create -


i have few controls creating @ runtime , add form of container (in case panel). while creating controls set tabindex of each one. now, start @ last control (textbox #4) , work forward first control ends @ top. enter image description here

i taking account i'm doing in reverse when setting tabindex, when run code , press tab key jumps #4 -> #3 -> #2 -> #1 (in order created, not top bottom want). when debugging can see each controls tabindex set correctly (textbox#1.tabindex = 1, ..., textbox#4.tabindex = 4) missing or there workaround?

code:

panel pnl = new panel(); (for int = fields.count -1; <= 0; i--) {    label lbl = new label();    //do stuff label    lbl.tabindex = (i + 1);    pnl.controls.add(lbl); } 

from: https://msdn.microsoft.com/en-us/library/bd16a8cw%28v=vs.80%29.aspx?f=255&mspperror=-2147217396

by default, first control drawn has tabindex value of 0, second has tabindex of 1, , on.

so can assume +1 incorrect.

panel pnl = new panel(); (for int = fields.count -1; <= 0; i--) {    label lbl = new label();    //do stuff label    lbl.tabindex = i;    pnl.controls.add(lbl); } 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -