473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

aligning text in textBox

175 100+
Is there a way to set the position of text in a textBox?

for example, I'm reading from an excel file, several columns with several rows, then putting it in a textBox...so the alignment is gonna be a little weird. I tried using "Chr" inserting tabs, but it just doesn't work, it's off a little. Then I tried to do some funny stuff with textWidth, but the columns still didn't come out aligned.

So, is there a way to tell it what position (horizontally) to put text in a text box? I'll need to do this 4 to 5 times a line.
Apr 4 '07 #1
3 9237
iburyak
1,017 Expert 512MB
Text box in VB has Alignment property.

[PHP]Text1.Alignment = 0 'Left Justify
Text1.Alignment = 1 'Right Justify
Text1.Alignment = 2 'Center[/PHP]
Apr 4 '07 #2
manontheedge
175 100+
I actually looked into alignment...not into great detail though because I'm gonna have several columns, not just 3, so I didn't think that would work if I have 4-6 columns.
Apr 4 '07 #3
iburyak
1,017 Expert 512MB
Try to use fixed length strings instead:

Try this:

[PHP]Dim col1 As String * 20
Dim col2 As String * 20
Dim col3 As String * 20


col1 = "aa"
col2 = "bbbbb"
col3 = "ccccc"


Text1 = col1 & col2 & col3

col1 = "aaaa"
col2 = "bbb"
col3 = "c"

Text1 = Text1 & vbCrLf & col1 & col2 & col3[/PHP]
Apr 4 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Rookie | last post by:
I need to display several columns of numbers in a textbox. I wish to display the columns with the decimal point position aligned vertically. I have found that the # digit placeholders do not...
0
by: mkarja | last post by:
Hi, I have a GUI which has textboxes in it. Those boxes can contain either numbers or text. The problem is that the numbers allways goes to the other side of the box than text. They should both...
1
by: tesc | last post by:
I'm sure this is pretty simple but I'm having a hard time with it. I have a report that has multiple columns and have to change some of the titles in the page header. As a result, the titles don't...
2
by: Dave | last post by:
Hello all, I need to know if you can vertically align Items within an ItemTemplate. For example I have two columns, one column has a stack of 6 textboxes, my second column can have 1 to n...
5
by: Raj | last post by:
Hi, I have a ASP.NET project which is working fine and I need to align controls in a .aspx page. The webform( .aspx page) has variety of controls (labels, textboxes, radio buttons etc) and when...
11
by: designkitt | last post by:
Hello, I am having a problem aligning a cell in a table and have tried everything I can think of to correct this without any luck: It appears that the white area, which is an image in the background...
2
by: agbee1 | last post by:
Hello: I've finally made the effort to ween myself from overly using tables and use CSS for my positioning. However, I am having a problem with my navigational menu properly aligning in Firefox,...
2
by: gubbachchi | last post by:
Hi all, I have a problem with css table. The code below works fine with firefox but the problem is with Internet explorer. This code actually fetches data from mysql database and display it in...
10
unstoppablekatia
by: unstoppablekatia | last post by:
I have a website that has images on it, and underneath the images are text. My only option of aligning the images and text separate from each other, is to do <div align="right">, <center>, or <div...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.