Text colors under buttons

  • Thread starter Thread starter Darin
  • Start date Start date
D

Darin

I have a form with a panel. On the panel, I have dynamically created
labels with the backcolor of control.lightlight, with a width of 200
pixels. I then dynamically create buttons next to the labels, but at
about pixel position 75, so some of the label is under the button. My
problem is the button is not on top of the label - the back color of the
label is on top of the button.

I have tried panel.suspendlayout first, then resumelayout after
everything has been added, but that didn't work.

I am adding the text and buttons using:

panel.suspendlayout
loop to build text boxes
panel.controls.add(xtext)
end loop

loop to build buttons
panel.controls.add(xbutton)
end loop
panel.resumelayout

Any ideas?

Darin
 
Hi Darin,

Right-click on the button in the Form Designer and select Bring to Front.

Regards,
Fergus
 
Hi again Darin,

Lol. Oops, you said <dynamically> created!

In which case use
ButtonX.BringToFront
or
LabelY.SendToBack
in your code.

Regards,
Fergus
 
* Darin said:
I have a form with a panel. On the panel, I have dynamically created
labels with the backcolor of control.lightlight, with a width of 200
pixels. I then dynamically create buttons next to the labels, but at
about pixel position 75, so some of the label is under the button. My
problem is the button is not on top of the label - the back color of the
label is on top of the button.

I have tried panel.suspendlayout first, then resumelayout after
everything has been added, but that didn't work.

Maybe you want to call the control's 'BringToFront' method to show it
in front of an other control.
 
Back
Top