Tuesday 15 March 2011

vb.net layering of controls not working properly -


I just want to add three controls to my form, the first two are shown, but the third does not. I do not understand why this behavior is happening. I tried to use .bringToFront (), but I ended up with the same result I also tried to use Me.controls.setChildIndex (), but that does not help any < P> I am at a loss, something would have been going wrong. help please.

Thank you.

This is my code:

  'Add label' ----------- ------- In the form of dim menu lab New label menu_label Text = "menu" menu_label.place = new point (50, 20) menu_label.Width = 50 menu_label.font = new font (main_font, main_font_size, font style.regular) Menu_label.Forecolor = Color. give me. Control. Add (menus_label) 'create image' --------------- Dim image logo as new logo dim image logo_image = My.Resources logo logo.Image = logo_image logo Width = 30 logos Heights = 30 logos Lift = 5 logo Hat = 0 my Control. Add (Logo) 'Add a Line' ---------- New Line Line as Slow Line Heights = 1 line Predicate = mi Wide line Back color = color Red line Place = new point (0, 32) m Control. Add (line) 'End code' ---- -----------------------------   < P> Only the first two items show no matter the order I put them in. So I either just label the logo and menu, or just get the logo and line, or just the line and menu label it's crazy!  

So I tried:

  me.Controls.SetChildIndex (logo, 0) Me.Controls.SetChildIndex (menu_label, 1) Me.Controls.SetChildIndex (Line, 2)   

Any item which is assigned to Level 2 never shows.

I also tested and worked fine for me, changed the form to blackmail blacklist so that You can see results better:

layout troubleshooting test

  Private Sub Forms 1_load (Sender as System Object, and System.AventAg) MyBase.Load 'Add Label' --------------- --- New label menu in the form of a dim menu lab label Text = "menu" menu_label. Place = new point (50, 20) menu_labels. With = 50 'menu_labal.font = new font (main_font, main_font_size, font style regular) menu_label.Forecolor = color White Control. Add (Menu_Label) 'Create Image' --------------- Image as a Dynamic Picture Logo in the form of a new logo 'logo_image = My.Resources.logo' Logo.Image = logo_image logo .BackColor = Color.Yellow logo.Width = 30 Logo Heights = 30 logos Lift = 5 logo Hat = 0 my Control. Add (Logo) 'Add a Line' ----- New Line Line ----- Slow Line Heights = 1 line Predicate = mi Wide line Back color = color Red line Place = new point (0, 32) m Control. Add (line) me BackColor = Color Black and sub   

What's more on your form? Maybe you can post screenshots?

No comments:

Post a Comment