Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 1st, 2007, 11:58 AM
Authorized User
Points: 111, Level: 2
Points: 111, Level: 2 Points: 111, Level: 2 Points: 111, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old March 1st, 2007, 12:07 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
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
================================================== =========
Reply With Quote
  #3 (permalink)  
Old March 1st, 2007, 06:26 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
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...
Reply With Quote
  #4 (permalink)  
Old March 2nd, 2007, 09:06 AM
Authorized User
Points: 111, Level: 2
Points: 111, Level: 2 Points: 111, Level: 2 Points: 111, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:06 AM.


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