Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

DOUBLE PTS combo box to populate six picture boxes.

Posted on 2006-03-22
18
Medium Priority
?
255 Views
Last Modified: 2011-08-18
*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.jpg) 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!!
0
Comment
Question by:Kit_Kat111
  • 11
  • 3
  • 2
16 Comments
 
LVL 14

Expert Comment

by:PockyMaster
ID: 16261159
Can you specify what you want exactly?

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?
0
 

Author Comment

by:Kit_Kat111
ID: 16261232
actually....
0
 

Author Comment

by:Kit_Kat111
ID: 16261237
ooops...I meant exactly....can you tell I am tired?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:PockyMaster
ID: 16261373
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.
0
 

Author Comment

by:Kit_Kat111
ID: 16261482
Whoa...I am just learning this stuff. Plus all my files vary, and are numerous. I really need help coding.......
0
 

Author Comment

by:Kit_Kat111
ID: 16262933
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_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbTime.SelectedIndexChanged
        '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
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 16264475
Here's a guess:

   Private Sub cmbTime_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles   cmbTime.SelectedIndexChanged

       Dim folder As String = "Cam" & Me.cmbDate.SelectedIndex

       Dim fileName As String = folder & "\" & Me.cmbTime.Text

       Me.pcbCam1.Image = Image.FromFile(fileName)

    End Sub

Bob
0
 

Author Comment

by:Kit_Kat111
ID: 16264571
I appreciate your input!

it seems that path is wrong, I got debug output when I used the combo box:

Cam0\Cam1-20060224165648-01.jpg
0
 

Author Comment

by:Kit_Kat111
ID: 16264659
so I need Cam0 to skip over and start with Cam 1 (with a space)....not my files to rename. :(
0
 

Author Comment

by:Kit_Kat111
ID: 16264788
see you got me started....thank you...part of it is working...

        Dim dt As DateTime = DateTime.ParseExact(cmbDate.Items(cmbDate.SelectedIndex), "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!
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16270390
Does that mean that you need all 6 displayed at the same time?

Bob
0
 

Author Comment

by:Kit_Kat111
ID: 16270400
I got it working using some case statements ...thank you Bob for your help
0
 

Author Comment

by:Kit_Kat111
ID: 16270407
Yes....I need all working at the same time....I do have a problem with it though....but I will award points first
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16270443
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
0
 

Author Comment

by:Kit_Kat111
ID: 16270561
still trying to fix this....

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21784980.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!
0
 

Author Comment

by:Kit_Kat111
ID: 16297367
can you delete this question?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question