|
-
Jun 17th, 2005, 08:02 AM
#1
Thread Starter
Hyperactive Member
how to center the groupbox text
I want to align my groupbox title to center, not the default "left", how can I do it? Thanks.
-
Jun 17th, 2005, 08:04 AM
#2
Re: how to center the groupbox text
You can't.
Have a nice day.
-
Jun 17th, 2005, 08:08 AM
#3
Re: how to center the groupbox text
PS, unless you do one of the following:
1. Inherit from Groupbox (or panel) and override the paint method.
2. Insert a bunch of whitespace to shove the text along a bit.
3. Write your own control from scratch.
I don't live here any more.
-
Jun 17th, 2005, 08:10 AM
#4
Thread Starter
Hyperactive Member
Re: how to center the groupbox text
thanks. That sounds complicated. Do you have sample code to help?
-
Jun 17th, 2005, 08:18 AM
#5
Re: how to center the groupbox text
Afraid not, sorry. Maybe someone else has tackled this before.
Anyone?
I don't live here any more.
-
Jun 17th, 2005, 09:02 PM
#6
Re: how to center the groupbox text
It's a bit of a hack but an easy way is to not enter any text for the GroupBox and then just put a Label where you want the text to be. Note that you must make sure that the label's parent control is the form and not the group box or it will not display properly. You could create a UserControl that includes a GroupBox and a Label that will handle the positioning of the label automatically. I use a similar method to appear to include a CheckBox in the text of the group box.
-
Jun 20th, 2005, 06:19 AM
#7
Thread Starter
Hyperactive Member
Re: how to center the groupbox text
-
Oct 27th, 2021, 01:08 AM
#8
Registered User
Re: how to center the groupbox text
 Originally Posted by Palmtree
I want to align my groupbox title to center, not the default "left", how can I do it? Thanks.
Try space it " Camera1", it will work.
-
Oct 31st, 2021, 05:01 PM
#9
Re: how to center the groupbox text
 Originally Posted by palanimaa
Try space it " Camera1", it will work.
It leaves an incomplete border space before the title text. JMcilhinney's suggestion will work
Attachment 182850
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|