Kit_Kat111
asked on
DOUBLE PTS combo box to populate six picture boxes.
*need quick!*
Trying to figure this out and learn in the process.
I have a combo box (cmbTime) with a populated list of jpgs (Cam1-20060224165648-01.jp g) that needs to be displayed in a picture box, however that same file name is also located in six other folders (Cam 1, Cam 2, Cam 4, Cam 6, Cam 7, and Cam 8) using appropiate date selected from another combo box (cmbDate). The six picture boxes are named: pcbCam1, pcbCam2, pcbCam4, pcbCam6, pcbCam7. Can someone help please? I will award double points since I need this quickly and need lots of help! Thank you!!
Trying to figure this out and learn in the process.
I have a combo box (cmbTime) with a populated list of jpgs (Cam1-20060224165648-01.jp
ASKER
actually....
ASKER
ooops...I meant exactly....can you tell I am tired?
Aaargh..damn mouse.. I typed your complete solution, and then click the awefull backnavigation button on my mouse and lost the whole story.
Well do something like this...create a class containing all your files
create a class containing a single file, exposing FileName and Path
attach the list of fileItem class objects to the datasource of your combobox
set the display member to the FileName
use your files class to get the attached files after you selected a single one
use image objects to load images for them and attach them to your pictureboxes.
Well do something like this...create a class containing all your files
create a class containing a single file, exposing FileName and Path
attach the list of fileItem class objects to the datasource of your combobox
set the display member to the FileName
use your files class to get the attached files after you selected a single one
use image objects to load images for them and attach them to your pictureboxes.
ASKER
Whoa...I am just learning this stuff. Plus all my files vary, and are numerous. I really need help coding.......
ASKER
Sorry that I am learning but I have no choice but to ask for help. Thank you for your interest in helping me.
So far this is what I have written up, not much but I am trying.
Private Sub cmbTime_SelectedIndexChang ed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbTime.SelectedIndexChang ed
'testing
If cmbDate.SelectedValue Then
'error msg
Else
Select Case cmbDate.SelectedValue = "February 24, 2006"
get folder 1 = pcbCam1
get folder 2 = pcbCam2
get folder 4 = pcbCam4
get folder 6 = pcbCam6
get folder 7 = pcbCam7
get folder 8 = pcbCam8
Case cmbDate.SelectedValue = "February 27, 2006"
Case cmbDate.SelectedValue = "February 28, 2006"
End Select
End If
End Sub
So far this is what I have written up, not much but I am trying.
Private Sub cmbTime_SelectedIndexChang
'testing
If cmbDate.SelectedValue Then
'error msg
Else
Select Case cmbDate.SelectedValue = "February 24, 2006"
get folder 1 = pcbCam1
get folder 2 = pcbCam2
get folder 4 = pcbCam4
get folder 6 = pcbCam6
get folder 7 = pcbCam7
get folder 8 = pcbCam8
Case cmbDate.SelectedValue = "February 27, 2006"
Case cmbDate.SelectedValue = "February 28, 2006"
End Select
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I appreciate your input!
it seems that path is wrong, I got debug output when I used the combo box:
Cam0\Cam1-20060224165648-0 1.jpg
it seems that path is wrong, I got debug output when I used the combo box:
Cam0\Cam1-20060224165648-0
ASKER
so I need Cam0 to skip over and start with Cam 1 (with a space)....not my files to rename. :(
ASKER
see you got me started....thank you...part of it is working...
Dim dt As DateTime = DateTime.ParseExact(cmbDat e.Items(cm bDate.Sele ctedIndex) , "MMMM d, yyyy", Nothing)
Dim folder As String = "C:\Projects\Darryl\Queue Review Files\" & dt.Month & "-" & dt.Day & "\Cam " & Me.cmbDate.SelectedIndex + 1
Dim fileName As String = folder & "\" & Me.cmbTime.Text
Me.pcbCam1.Image = Image.FromFile(fileName)
First picture is displayed....but I need the other pcbCam# files to be showing too....I am so happy thank you!! This is so much better than a few hours ago!
Dim dt As DateTime = DateTime.ParseExact(cmbDat
Dim folder As String = "C:\Projects\Darryl\Queue Review Files\" & dt.Month & "-" & dt.Day & "\Cam " & Me.cmbDate.SelectedIndex + 1
Dim fileName As String = folder & "\" & Me.cmbTime.Text
Me.pcbCam1.Image = Image.FromFile(fileName)
First picture is displayed....but I need the other pcbCam# files to be showing too....I am so happy thank you!! This is so much better than a few hours ago!
Does that mean that you need all 6 displayed at the same time?
Bob
Bob
ASKER
I got it working using some case statements ...thank you Bob for your help
ASKER
Yes....I need all working at the same time....I do have a problem with it though....but I will award points first
I am still confused about how the images are stored for pcbCam1, pcbCam2, ....
Are they stored by date? Are there 6 images for each date in a folder?
Bob
Are they stored by date? Are there 6 images for each date in a folder?
Bob
ASKER
still trying to fix this....
https://www.experts-exchange.com/questions/21784980/help-a-NOOB-dbl-pts-combo-boxes-selection-to-picture-boxes.html
Each jpg is a time stamp, there are six folders which are different camera views. So there will be six pictures (psbCam1) with the same time but at different angles.
Look at my second part of this question from the link above....thank you Bob!
https://www.experts-exchange.com/questions/21784980/help-a-NOOB-dbl-pts-combo-boxes-selection-to-picture-boxes.html
Each jpg is a time stamp, there are six folders which are different camera views. So there will be six pictures (psbCam1) with the same time but at different angles.
Look at my second part of this question from the link above....thank you Bob!
ASKER
can you delete this question?
Your combobox contains all the pictures you have?
You will select 1 of them and the application needs to select the pictures from the other folders containing the same date as the selected file and show them in the picturebox?
Something like that?