Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 27th, 2004, 03:53 PM
myrrdan's Avatar
myrrdan myrrdan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Alberta
Posts: 83 myrrdan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Question RESOLVED filling text box by columns rather than tabs

I'm trying to grab data out of a flexgrid and dump it into a textbox. But i need to put in in columns to neaten it up. Some of the entries are drastically different lenghts. Tabs does neaten each line up, but the total is fairly messy.
any ideas?
(or is it even possible lol)
i mean rather than finding the length of each str, and adding spaces to equal a total lenght... which would work i guess, but i'm hoping for an easier quicker way.

Last edited by myrrdan : January 29th, 2004 at 02:02 PM.

Reply With Quote
  #2  
Old January 27th, 2004, 04:07 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 44 m 30 sec
Reputation Power: 8
Why are you attempting to display grid data in a text box where the spacing is nearly uncontrollable? You will run into the scenarios where one field is five characters and the next field is twenty six and the next line has five and five. You will not be able to space these properly and have an aesthitcally please UI in a text box.
__________________
El éxito consiste en una serie de pequeñas victorias día a día

MySQL, MS SQL, MS ACCESS, Oracle Database Manager - http://victorpendleton.net/products/psdviewer.html

Reply With Quote
  #3  
Old January 27th, 2004, 04:17 PM
myrrdan's Avatar
myrrdan myrrdan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Alberta
Posts: 83 myrrdan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
The way they wanted the program to look. They want to ahve all the data in a scrollable box, rather than havign to choose seperate records etc like in a combo box. Other than a text box what else would be usable?
Data from the flex grid has to reorganized and then sent to the textbox.. then they want print options..
Worse comes to worse I can do string lenght checks, but was hoping there might be an easier way.

Reply With Quote
  #4  
Old January 27th, 2004, 04:29 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 44 m 30 sec
Reputation Power: 8
Flex grids are scrollable, sortable and you can print from any object if set up correctly.

Reply With Quote
  #5  
Old January 27th, 2004, 10:30 PM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,193 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 13 h 55 m 17 sec
Reputation Power: 142
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
don't use a text box. You need to use a listbox. What you have to do is determine a "print chart" for your listbox. Basically, you have to plot your fields into columns. To do this, you need to have a good idea of the longest value you will have in each field in your database. Then you tack on some extra space. It's a bit more complicated than that, but if you want the specifics, I'll send you some sample code on how to get it to line up.

Reply With Quote
  #6  
Old January 29th, 2004, 02:01 PM
myrrdan's Avatar
myrrdan myrrdan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Alberta
Posts: 83 myrrdan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Thanks for the suggestions. I used a simple formula to find the longest value, then added a few spaces to it, then used that number in a loop to add a space at the end of each string.
It lines up almost, since spaces & characters are two different sizes.
Its good enough for what they want. When i send it to the textfile, then its much better organized, which is what they really wanted it for.
Thanks for the help anyways.
But I woudnt mind the code for the columned listbox. Could come in handy.
if don't have my email its

Myrrdans Email

Reply With Quote
  #7  
Old January 29th, 2004, 03:12 PM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,193 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 13 h 55 m 17 sec
Reputation Power: 142
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
No problem, I'll send it to you later. It lines everything up very nicely.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > filling text box by columns rather than tabs


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT