Page #124 (Case 3: Size Loss)

 

Creating Controls in a Specific Order

Since you verified earlier that label1 disappears underneath the panel directly below it when its location is changed from (190, 20) to (190, 70), how come we were able to construct a second label, Label on Top of Panel 1, that did not disappear below the panel? This label was constructed after the panel and placed within the panel, so it appears on top of the panel.

The only way to ensure that the controls appear in the proper position (one on top of the other) is to create them in an order such that the control that appears in the background is created first. You cannot, for example, create a radio button at some location, then place a group box on top of it, and then bring the radio button out to the front layer. If the group box was created after the radio button, it will hide the radio button, period.

 


Unlocking Microsoft C# V 2.0 Programming Secrets
Unlocking Microsoft C# V 2.0 Programming Secrets (Wordware Applications Library)
ISBN: 1556220979
EAN: 2147483647
Year: 2005
Pages: 129

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net