|
-
Nov 7th, 2003, 01:05 PM
#1
Thread Starter
Frenzied Member
Second Tab in a MenuItem displayed as a square.
I'm dynamically creating menu items from a few database columns. I want to format the line of text so it looks clean, so I tried separating with tabs. Problem is, only the first tab gets displayed as a tab, the second and third will get displayed as a square.
Any ideas? Code snippet:
VB Code:
cmd.CommandText = "SELECT Agency, Call, Violation FROM vActiveCalls"
dr = cmd.ExecuteReader
While dr.Read
mi.MenuItems.Add(dr.GetString(0) & Chr(9) & dr.GetString(1) & Chr(9) & dr.GetString(2))
End While
-
Nov 7th, 2003, 01:17 PM
#2
Try using ControlChars.Tab or " " instead of Chr(9) and see if that works.
-
Nov 7th, 2003, 01:48 PM
#3
Thread Starter
Frenzied Member
ControlChars.Tab, Chr(9) and vbTab all produce the same (bad) result.
A space (" ") does work ok, but I was hoping for column-type formatting when the column text is of varying length.
-
Nov 7th, 2003, 02:18 PM
#4
Actually I tried to put 5 spaces but HTML ruined it I guess. To create a column effect you can could try using the Pad methods. If you use a fixed width font like New Courier then it works well other wise it just gets you sort of there. Here is an example:
VB Code:
Dim col1() As String = {"Ed", "Mike", "Cookie"}
Dim col2() As String = {"Developer", "Hardware Tech", "Vice President"}
Dim col3() As String = {"$43,000", "$35,000", "$85,000"}
Dim collength As Integer = 18
For x As Integer = 0 To 2
mnuTest.MenuItems.Add(col1(x).PadRight(collength) & col2(x).PadRight(collength) & col3(x).PadRight(collength))
Next
Actually after testing it might not be what you want.
Last edited by Edneeis; Nov 7th, 2003 at 02:21 PM.
-
Nov 7th, 2003, 03:58 PM
#5
Thread Starter
Frenzied Member
I'll give that a try, thanks. This is a reponse I got from a microsoft news group:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|