2 Replies - 167 Views - Last Post: 04 May 2019 - 12:10 PM Rate Topic: -----

#1 pjfatboy1   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 27-February 16

Working with child form

Posted 04 May 2019 - 10:31 AM

I have 3 child forms in my Mdi form. When passing data to my child forms works fine except for one. I am trying to load an image in a picturebox on Form4 which is inv4 from my Mdi form. Here is my code, can someone tell me why I'm not able to load the image?
Dim parentNode As TreeNode = TreeView1.SelectedNode.Parent
If parentNode IsNot Nothing Then
    Dim SourcePath As String = "C:\Users\price\OneDrive\App Files\" & TreeView1.SelectedNode.Parent.Text.ToString & "\" &    TreeView1.SelectedNode.Text.ToString & ".jpg"
    If System.IO.File.Exists(SourcePath) Then
        MsgBox("File does exist.")
        inv4.pbDrawing.Image = Image.FromFile(SourcePath) '"C:\Users\price\OneDrive\App Files\" & TreeView1.SelectedNode.Parent.Text.ToString & "\" & TreeView1.SelectedNode.Text.ToString & ".jpg")
    Else
        MsgBox("This drawing does not exist.")
    End If
End If


This post has been edited by pjfatboy1: 04 May 2019 - 10:33 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Working with child form

#2 pjfatboy1   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 27-February 16

Re: Working with child form

Posted 04 May 2019 - 11:04 AM

Sorry, I found my problem. It was a typo.
Was This Post Helpful? 0
  • +
  • -

#3 Sheepings   User is offline

  • Senior Programmer
  • member icon

Reputation: 223
  • View blog
  • Posts: 1,260
  • Joined: 05-December 13

Re: Working with child form

Posted 04 May 2019 - 12:10 PM

If I can make two suggestions when working with paths and strings that you wish to merge? String.Concat and Path.Combine Makes your life easier. ;)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1