Click here to Skip to main content
15,887,746 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Allowing User To Upload Image to Resources folder and Displaying in PictureBox Pin
Dan O'Riordan3-Feb-14 3:17
Dan O'Riordan3-Feb-14 3:17 
GeneralRe: Allowing User To Upload Image to Resources folder and Displaying in PictureBox Pin
Richard MacCutchan3-Feb-14 8:17
mveRichard MacCutchan3-Feb-14 8:17 
AnswerRe: Allowing User To Upload Image to Resources folder and Displaying in PictureBox Pin
Dave Kreskowiak3-Feb-14 4:37
mveDave Kreskowiak3-Feb-14 4:37 
GeneralRe: Allowing User To Upload Image to Resources folder and Displaying in PictureBox Pin
Dan O'Riordan3-Feb-14 17:24
Dan O'Riordan3-Feb-14 17:24 
GeneralRe: Allowing User To Upload Image to Resources folder and Displaying in PictureBox Pin
Dave Kreskowiak3-Feb-14 18:14
mveDave Kreskowiak3-Feb-14 18:14 
GeneralRe: Allowing User To Upload Image to Resources folder and Displaying in PictureBox Pin
Dan O'Riordan3-Feb-14 18:21
Dan O'Riordan3-Feb-14 18:21 
GeneralRe: Allowing User To Upload Image to Resources folder and Displaying in PictureBox Pin
Dan O'Riordan4-Feb-14 2:04
Dan O'Riordan4-Feb-14 2:04 
GeneralRe: Allowing User To Upload Image to Resources folder and Displaying in PictureBox Pin
Dave Kreskowiak4-Feb-14 3:56
mveDave Kreskowiak4-Feb-14 3:56 
There isn't enough code here to definitively say what's wrong. But, one problem I see is that you're using relative path names. You're ASSUMING that the "current directory" is always the same. That's just not true, especially when using the Open/SaveFile dialogs. They change the "current directory" as you navigate through them.

ALWAYS, ALWAYS, ALWAYS, build and use absolute paths using well-known roots, such as:
Dim appPath As String = Application.StartupPath
Dim resourcesFolderPath As String = Path.Combine(appPath, "Resources")
Dim imageFilePath As String = Path.Combine(resourcesFolderPath, someUserPickedFilename)

Also, use Path.Combine to build paths. What you're doing, first, contains double backslash characters, which don't apply in VB.NET, only in C/C++/C#. Using Path.Combine, you don't worry about the backslashes at all.

You don't have to slpit a filepath from an OpenFileDialog. It'll return the full path to the selected file. From there, you use the Path class and its methods to get the filename. You don't need to split the string on, again, double backslashes which don't work in VB.NET. In VB.NET, it's a single backslash.
Dim filename As String = Path.GetFileName(userSelectedPath)


AnswerRe: Allowing User To Upload Image to Resources folder and Displaying in PictureBox Pin
TnTinMn4-Feb-14 14:28
TnTinMn4-Feb-14 14:28 
GeneralRe: Allowing User To Upload Image to Resources folder and Displaying in PictureBox Pin
Dan O'Riordan4-Feb-14 23:07
Dan O'Riordan4-Feb-14 23:07 
GeneralRe: Allowing User To Upload Image to Resources folder and Displaying in PictureBox Pin
TnTinMn5-Feb-14 2:31
TnTinMn5-Feb-14 2:31 
GeneralRe: Allowing User To Upload Image to Resources folder and Displaying in PictureBox Pin
TnTinMn5-Feb-14 11:12
TnTinMn5-Feb-14 11:12 
QuestionProblem with AutoHidePortion in DockPanel Suite 2.8.0 (VB2010) Pin
TheComputerMan31-Jan-14 4:54
TheComputerMan31-Jan-14 4:54 
AnswerRe: Problem with AutoHidePortion in DockPanel Suite 2.8.0 (VB2010) Pin
Eddy Vluggen31-Jan-14 6:22
professionalEddy Vluggen31-Jan-14 6:22 
GeneralRe: Problem with AutoHidePortion in DockPanel Suite 2.8.0 (VB2010) Pin
TheComputerMan31-Jan-14 6:26
TheComputerMan31-Jan-14 6:26 
GeneralRe: Problem with AutoHidePortion in DockPanel Suite 2.8.0 (VB2010) Pin
Eddy Vluggen1-Feb-14 7:11
professionalEddy Vluggen1-Feb-14 7:11 
GeneralRe: Problem with AutoHidePortion in DockPanel Suite 2.8.0 (VB2010) Pin
TheComputerMan1-Feb-14 7:19
TheComputerMan1-Feb-14 7:19 
GeneralRe: Problem with AutoHidePortion in DockPanel Suite 2.8.0 (VB2010) Pin
Eddy Vluggen1-Feb-14 8:14
professionalEddy Vluggen1-Feb-14 8:14 
QuestionMaking label on UserControl work as default click event Pin
Floodlight29-Jan-14 17:49
Floodlight29-Jan-14 17:49 
AnswerRe: Making label on UserControl work as default click event Pin
TnTinMn29-Jan-14 18:16
TnTinMn29-Jan-14 18:16 
GeneralRe: Making label on UserControl work as default click event Pin
Floodlight29-Jan-14 18:44
Floodlight29-Jan-14 18:44 
AnswerRe: Making label on UserControl work as default click event Pin
Dave Kreskowiak29-Jan-14 18:17
mveDave Kreskowiak29-Jan-14 18:17 
GeneralRe: Making label on UserControl work as default click event Pin
Floodlight29-Jan-14 18:45
Floodlight29-Jan-14 18:45 
QuestionImplement an Interface in designed DataContext Pin
Rene Rose27-Jan-14 20:06
Rene Rose27-Jan-14 20:06 
SuggestionRe: Implement an Interface in designed DataContext Pin
Richard MacCutchan27-Jan-14 22:20
mveRichard MacCutchan27-Jan-14 22:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.