|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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. |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
||||
|
||||
|
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. |
|
#4
|
|||
|
|||
|
Flex grids are scrollable, sortable and you can print from any object if set up correctly.
|
|
#5
|
||||
|
||||
|
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.
|
|
#6
|
||||
|
||||
|
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 |
|
#7
|
||||
|
||||
|
No problem, I'll send it to you later. It lines everything up very nicely.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > filling text box by columns rather than tabs |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|