Wrox Programmer Forums
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 1st, 2007, 11:58 AM
Authorized User
 
Join Date: Dec 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Center Text In ComboBox

I can't seem to find a property that sets text displayed in a combobox to the center of the box.

Is there a way to do this? Maybe I just missing something obvious!

George

 
Old March 1st, 2007, 12:07 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

No the text is always left aligned unles you change the RightToLeft property which will then change the alignment to the Left. (However this deals with languages that are read from Right to Left as opposed to left to right.) You may be able to override the control to get the text to center itself, hoewver, I am not sure of that.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old March 1st, 2007, 06:26 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Just sort of thinking out loud... Perhaps you could substitute a RichTextBox, formatted to look like a textbox, and set the format of the text to be centered (rather than setting the control to do the centering).

You could fake it by padidng the text with spaces, but (of course) if the box is connected to data that would be no good...
 
Old March 2nd, 2007, 09:06 AM
Authorized User
 
Join Date: Dec 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Appreciate the comments from the both of you. I keep thinking there just has to be a better way, but sure don't seem to be able to come up with it.

Will keep watching, maybe someone has a solution.

George






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to center text/image/any object into a div beetle_jaipur BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 3 January 24th, 2013 01:25 PM
Center Text within Label testsubject Visual Studio 2005 5 October 15th, 2011 12:59 PM
ComboBox text ts0708 Excel VBA 1 June 11th, 2007 02:05 PM
center text (only) in fixed size div, how to do it beetle_jaipur BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 April 16th, 2007 01:38 PM
How to capture the combobox text ??? thomaz C# 2 September 22nd, 2003 08:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.