469,963 Members | 2,561 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,963 developers. It's quick & easy.

Text colors under buttons

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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
4 1009
Hi Darin,

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

Regards,
Fergus
Nov 20 '05 #2
Hi again Darin,

Lol. Oops, you said <dynamically> created!

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

Regards,
Fergus
Nov 20 '05 #3
* Darin <darin_nospam@nospamever> scripsit:
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.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Thanks. For some reason I never noticed that.

Darin

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by dzeeq | last post: by
4 posts views Thread by Frank Hoek | last post: by
1 post views Thread by Ben | last post: by
2 posts views Thread by Cliff Lane | last post: by
10 posts views Thread by Michael B. Trausch | last post: by
iam_clint
4 posts views Thread by iam_clint | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.