Hi James,
Thanks for your reply. It has solved my problem. (Although I have learned
that in my case BringToFront works for me if I use it in the right place.)
For the benefit of anyone who might have the same problem and come across
this thread I will point out that, in my experience, you have to do the
..SendToBack AFTER you do the .Controls.Add(). So in my code ...
Form1.Controls.Add(VarList)
Form1.rec.SendToBack()
where VarList is the ListBox and rec is the thing that was interfering with
the display of VarList.
THEN ... I got to thinking about how inaptly the BringToFront method is
named - I mean what does "bring to front" mean when the instance does not
end up in front. AND THEN I recalled that when I tried BringToFront it was
BEFORE the .Controls.Add. SO ... I thought ... well, why not do a little
experiment in which I do the BringToFront AFTER the .Controls.Add. And, in
my situation, that works too. I.E. the following code, using BringToFront,
worked as well as the code shown above.
Form1.Controls.Add(VarList)
'Form1.rec.SendToBack() ' note that this is a comment here
VarList.BringToFront()
So, while I am able to use, or can get away with using, BringToFront, I
would not have solved my problem and would not have learned that WHERE you
do the SendToBack/BringToFront is critical without your help.
Thanks, Bob