Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 03-25-2006, 09:05 PM   #1 (permalink)
Shaggycat
Registered User
 
Join Date: Mar 2006
Posts: 2
Shaggycat is on a distinguished road
Arrow Trying to use a default image...please help!

I am populating some pictureboxes from a combobox selection, that works until there is a jpg in the folder that doesn't exist. For some reason I can't get the default jpg to come up, can someone help me please?

Thanks in advance for the assistance.....


Code:
Private Sub cmbTime_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbTime.SelectedIndexChanged
        
        Dim folder As String = "C:\Projects\Dar\Queue Review Files\" & DateTime.ParseExact(cmbDate.SelectedItem.ToString, "MMMM d, yyyy", Nothing).ToString("M-d") & "\Cam {0}\Cam{0}" & cmbTime.Text.Substring(cmbTime.Text.IndexOf("-"))


        For i As Integer = 1 To 8

            Dim pcb As PictureBox = ApplicationControls.FindControl(Me, "pcbCam" & i)

            If Not pcb Is Nothing Then

                If File.Exists(String.Format(folder, 1)) Then
                    pcb.Image = Image.FromFile(String.Format(folder, i))


                Else
                    MsgBox("I am right here")

                   pcb.Image = Image.FromFile("C:\Projects\Dar\Queue Review Files\noimage.jpg")
                End If


            End If


        Next i

     

    End Sub
Shaggycat is offline   Reply With Quote
Old 03-26-2006, 04:36 PM   #2 (permalink)
Shaggycat
Registered User
 
Join Date: Mar 2006
Posts: 2
Shaggycat is on a distinguished road
fixed.....
If File.Exists(String.Format(folder, i)) Then
and that is it.
Shaggycat is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stationary Image joehouse HTML, XML, Javascript, AJAX 4 08-05-2005 07:03 PM
Default Constructors fp_unit Standard C, C++ 3 07-03-2005 09:37 AM
Mini Games Nitro PHP 18 11-11-2003 11:17 AM
I am a newb, how do you set multiple parts of an image as a link? I sniper baby HTML, XML, Javascript, AJAX 5 02-10-2003 06:40 PM


All times are GMT -8. The time now is 07:08 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting