What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Argh Visual Basic

Argh Visual Basic
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Argh Visual Basic
If you want to directly write/print to a form, you must take in account the type of font you're using. Normal/default fonts are not proportional (just like on this forum). This means that even if you put a tab character between your columns, the columns wouldn't be aligned properly and you will get this:

1 x 1 = 1         1 x 2 = 2         1 x 10 = 10         1 x 12 = 12
2 x 1 = 2         2 x 2 = 4         2 x 10 = 20         2 x 12 = 24
3 x 1 = 3         3 x 2 = 6         3 x 10 = 30         3 x 12 = 36
...
8 x 1 = 8         8 x 2 = 16         8 x 10 = 80         8 x 12 = 96
...
10 x 1 = 10         10 x 2 = 20         10 x 10 = 100         10 x 12 = 120

the columns aren't aligned.

So using tab characters to space your columns like this is almost always not advisable, just as to print directly to a form is almost always not advisable for the above reason. Also, printing 12 columns near each other will make your form very wide and inpracticle. A possible solution is the one shown by XM4ST3RX. This also shows that it is far better to not print directly to a form, but to a control. In the case of XM4ST3RX's code it are two listboxes.

To show what you want in theory, you could use a multiline textbox with a proporional font (eg: courier new) and using spaces to align the columns.

A bit more advanced would be to set tabstops in a control (listbox or textbox or whatever) and use the tabcharacter to align the columns. Setting tabstops must be done by calling an API; something you're not ready yet to use I assume :)

Anyways, here is the code to print all your columns side by side into a multiline textbox and using spaces to align the columns:

PS @ XM4ST3RX:
Do NOT do:
    Dim TimesTable, Number as integer
This will NOT declare TimesTable as an integer, but as a variant! Always seperate your declare statements to avoid such errors:
Dim Number As Integer
Dim TimesTable As Integer

.zip File Attachment: sample1.zip (2.21 KB)
This file has been downloaded 198 time(s).

This post was edited on 03-04-2005 at 10:21 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-04-2005 09:09 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Argh Visual Basic - by Wabz on 03-03-2005 at 07:02 PM
RE: Argh Visual Basic - by CookieRevised on 03-03-2005 at 07:35 PM
RE: Argh Visual Basic - by Wabz on 03-03-2005 at 07:40 PM
RE: Argh Visual Basic - by CookieRevised on 03-03-2005 at 07:44 PM
RE: Argh Visual Basic - by Wabz on 03-03-2005 at 07:47 PM
RE: Argh Visual Basic - by Dempsey on 03-03-2005 at 08:09 PM
RE: Argh Visual Basic - by Wabz on 03-03-2005 at 08:19 PM
RE: Argh Visual Basic - by Dempsey on 03-03-2005 at 08:41 PM
RE: Argh Visual Basic - by Wabz on 03-03-2005 at 08:46 PM
RE: Argh Visual Basic - by Dempsey on 03-03-2005 at 08:51 PM
RE: Argh Visual Basic - by matty on 03-03-2005 at 09:02 PM
RE: Argh Visual Basic - by Wabz on 03-03-2005 at 11:28 PM
RE: Argh Visual Basic - by segosa on 03-04-2005 at 12:04 AM
RE: Argh Visual Basic - by Wabz on 03-04-2005 at 01:09 AM
RE: Argh Visual Basic - by matty on 03-04-2005 at 01:53 AM
RE: Argh Visual Basic - by XM4ST3RX on 03-04-2005 at 02:34 AM
RE: Argh Visual Basic - by CookieRevised on 03-04-2005 at 09:09 AM
RE: Argh Visual Basic - by Wabz on 03-04-2005 at 01:36 PM
RE: Argh Visual Basic - by siebe on 03-04-2005 at 02:08 PM
RE: Argh Visual Basic - by Mike on 03-04-2005 at 02:15 PM
RE: Argh Visual Basic - by Dempsey on 03-04-2005 at 02:25 PM
RE: Argh Visual Basic - by Wabz on 03-04-2005 at 02:44 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On