Little help please with SetChildIndex()

0
0

Visual Web GUI used something like  myCtl.Controls.Insert(index, childControl);

the WiseJ method “appears” to be :

myCtl.Controls.SetChildIndex(childControl, index);

Is this a direct clean exchange of functionality? The nesting I’m dealing with in the implementation

it making it difficult to confirm the basic functionality  versus the additional instances of Controls.Add.

I guess I’m asking if SetChildIndex accompanies Controls.Add or ALSO performs a Controls.Add while defining

the index of child control.

thank you

 

 

  • You must to post comments
0
0

Hello,

There are two ways to use the Controls.SetChildIndex method:

You can do Controls.Add() then Controls.SetChildIndex(),  or
((IList<Controls>)Controls).Insert(index, control)
To answer your question, SetChildIndex does not actually add the control, it has to be done AFTER you add the control.

HTH,
Alaa

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.