|
-
Nov 29th, 2006, 11:52 PM
#1
Thread Starter
New Member
[2005] Selecting an Item from a list and having an object appear
My class has a project where we make something that's supposed to resemble Netflix. I have code that lets one combo box have the genre's of movies in my form, and another that, when the genre (like "Romance") is selected, the movies in that genre will appear in another combo box.
My problem lies in the next step: clicking the movie itself (Like "Titanic") and having a picture of the DVD appear in one box and the information from the file Titanic.omf (I'm pretty sure that "omf" is not a real file name, but my teacher is absolutly positive that you can load it anyway) and Titanic png at the same time.
My current code looks like this:
Public Class Movie
Dim i As Integer
Dim strMovie As String
Dim strFileName(56) As String
Dim cshtFileLines As Object
Dim cstrMovieCrouchingTigerHiddenDragon As Object
Private Sub cboGenreSelector_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboGenreSelector.SelectedIndexChanged
FileOpen(1, "GoldenFiles\list.omf", OpenMode.Input)
Do Until EOF(1) = True
Input(1, strFileName(i))
i += 1
Loop
FileClose(1)
For i = 0 To strFileName.Length - 1
FileOpen(1, "GoldenFiles\" & strFileName(i), OpenMode.Input)
Input(1, strMovie)
cshtFileLines(i) = CShort(strMovie)
Input(1, strMovie)
Select Case strMovie
Case "Action & Adventure"
If cboGenreSelector.SelectedItem = "Action & Adventure" Then
cboActionAdventure.Visible = True
ElseIf Not cboGenreSelector.SelectedItem = "Action & Adventure" Then
cboActionAdventure.Visible = False
End If
Case "Classics"
End Select
Next
End Sub
At the moment, my current problem is that, when I try and run the program, it says that my "Object variable or With block variable not set" and I'm not sure what they are, even after trying the Help section. Of the code there, only the:
If cboGenreSelector.SelectedItem = "Action & Adventure" Then
cboActionAdventure.Visible = True
ElseIf Not cboGenreSelector.SelectedItem = "Action & Adventure" Then
cboActionAdventure.Visible = False
End If
is from my groups work. Everything else is from my teachers code.
Can anyone 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
|