|
-
Jul 10th, 2006, 10:16 AM
#1
Thread Starter
New Member
[RESOLVED] Strange Listbox Problem
For some reason the listbox in my application is centering the text.
My host does not allow remote database connections, so the application is linked to a PHP file that connects to the database and runs a query, then returns the data back to the application and dynamically populates the listbox at runtime.
Everything works exactly like I want it to, I just dont want the stuff centered in the listbox.
Heres the VB code:
VB Code:
Private Sub Form_Load()
Dim LinkResults As String
Dim i As Integer
Dim NameResults As String
Dim x As Integer
VidStatus.Enabled = True
VidStatus.Visible = True
VidStatus.Caption = "CHOOSE A VIDEO"
LinkResults = Inet1.OpenURL("http://www.xxxxxxxxxxxxxxxxxxx.com/info.php?do=getlinks")
For i = 0 To 1
VidLinks.AddItem (Split(LinkResults, "|")(i)), i
Next
NameResults = Inet1.OpenURL("http://www.xxxxxxxxxxxxxxxxxxx.com/info.php?do=getnames")
For x = 0 To 1
VidNames.AddItem (Split(NameResults, "|")(x)), x
Next
End Sub
Private Sub VidNames_Click()
VidStatus.Enabled = False
VidStatus.Visible = False
Dim lindex As Integer
lindex = VidNames.ListIndex
Player.URL = VidLinks.List(lindex)
End Sub
And heres the PHP:
PHP Code:
include('dbConn.php');
$sql=mysql_query("SELECT * FROM videos");
while($row=mysql_fetch_array($sql)) {
$vid=$row["ID"];
$vlink=$row["LINK"];
$vname=$row["VIDNAME"];
$shooter=$row["Shooter"];
if($_GET['do'] == "getlinks") {
echo $vlink."|";
}
if($_GET['do'] == "getnames") {
echo $vname."|";
}
}
And heres a screenshot of the text centered:

This is my first project with VB, any help would be greatly appreciated.
Last edited by DA2Ricky; Jul 10th, 2006 at 10:24 AM.
-
Jul 10th, 2006, 12:23 PM
#2
Re: Strange Listbox Problem
thats not centered... it looks like there might be spaces?
try
VB Code:
VidNames.AddItem Trim(Split(NameResults, "|")(x))), x
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jul 10th, 2006, 12:57 PM
#3
Thread Starter
New Member
Re: Strange Listbox Problem
I think you're right about the space, but that didn't work. I'll trim the PHP sent back to VB too.
Thanks for the input!
-
Jul 10th, 2006, 01:06 PM
#4
Re: Strange Listbox Problem
sure thing.. if it were centered.. the left side of the text wouldnt be lined up.. so thats what made me think it was spaces
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jul 10th, 2006, 01:13 PM
#5
Thread Starter
New Member
Re: Strange Listbox Problem
gotcha. It's a problem with the php, fixed.
Thanks again.
-
Jul 10th, 2006, 01:20 PM
#6
Re: [RESOLVED] Strange Listbox Problem
cool.. now .. how did u make your listbox look like that? (or form... or whatever?)
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jul 10th, 2006, 04:51 PM
#7
Thread Starter
New Member
Re: [RESOLVED] Strange Listbox Problem
photoshop CS, then put the whole image in as a picturebox and placed the controlls over top.
Heres the background image since you really couldn't see it all too well in the image I posted above.
Low Quality so I don't kill 56k users (if there are any these days).
Pretty much limited to black for the boxes until I can learn how to change the color of the actual WMP control, and listbox.
Last edited by DA2Ricky; Jul 13th, 2006 at 09:29 PM.
-
Jul 13th, 2006, 09:26 PM
#8
Thread Starter
New Member
Re: [RESOLVED] Strange Listbox Problem
I found out that somewhere in my hosts php config, it adds html tags by default.
So whats getting printed is actually <html><head></head><body>listitem|listitem2|</body></html>
I tried to strip the html tags within the php file, but because its in the config, it adds the tags anyway...
So my next question would be... how can I strip them within VB?
I tried to block the "<", ">", but apparently once their pulled into VB they are converted to some wierd chars.

HELP!!
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
|