Results 1 to 6 of 6

Thread: picturebox in execute

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2016
    Posts
    37

    picturebox in execute

    I have multiple Picturebox's in my form, which load with no problem.
    How can you include them in the execute so that I can run the program on another PC?

    Thanks

  2. #2
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    5,984

    Re: picturebox in execute

    I'm not sure what the issue is, i.e. what do you mean by Picturebox's loading.
    Are you talking about loading images in the picturebox, and if so, how do you load them now?
    Have you tried running the executable on another machine yet, and have it not work?

    If you loaded the image in the picturebox in the IDE, then the pictures should be added to the project as a resource and already be part of the executable.
    "Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930

  3. #3
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    104,950

    Re: picturebox in execute

    The PictureBoxes are part of your form and will already be displayed no matter what, just like TextBoxes and Buttons. You are presumably talking about the Images displayed in the PictureBoxes. What you want may already be the case but you haven't provided enough information for us to know. If you add the image file(s) to your project then they can be copied to the output folder along with the EXE and you can deploy the lot together, meaning that you can load a file from the program folder no matter where it is. There are also multiple ways to include the image data in the EXE itself. What EXACTLY are you doing now to load the Images and what exactly do you want: read-only data built into the EXE or separate files that could be deleted or replaced after deployment. In short, please provide a FULL and CLEAR explanation of the problem.

  4. #4
    Addicted Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    191

    Re: picturebox in execute

    Quote Originally Posted by jmcilhinney View Post
    There are also multiple ways to include the image data in the EXE itself.
    I know that if you add the pictures as resource, they are compiled with the EXE but I don't see an other way. I am curious, could you orient me ?
    Last edited by Delaney; Jun 30th, 2020 at 03:34 AM.
    The best friend of any programmer is a search engine
    "Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)

  5. #5
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    104,950

    Re: picturebox in execute

    Quote Originally Posted by Delaney View Post
    I know that if you add the pictures as resource, they are compiled with the EXE but I don't see an other way. I am curious, could you orient me ?
    1. Edit the Image property and select an image file to embed as a local resource, i.e. available only to that control.
    2. Edit the Image property and select an image file to embed as a project resource, which adds it to the Resources page of the project properties and exposes it via My.Resources.
    3. Add an image file on the Resources page of the project properties, which exposes it via My.Resources, then edit the Image property and select that resource.
    4. Add an image file on the Resources page of the project properties, which exposes it via My.Resources, then set the Image property in code from the property of My.Resources.

    All similar and only actually two ways to embed the file but four different ways to get the embedded Image into the control.

  6. #6
    Addicted Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    191

    Re: picturebox in execute

    Thanks for the explanation.
    The best friend of any programmer is a search engine
    "Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width