Results 1 to 11 of 11

Thread: picturebox in execute

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2016
    Posts
    38

    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
    6,013

    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
    105,027

    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
    212

    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
    105,027

    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
    212

    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)

  7. #7

    Thread Starter
    Member
    Join Date
    Aug 2016
    Posts
    38

    Re: picturebox in execute

    jmcilhinney response works great.

    Thanks for the help.

  8. #8
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,027

    Re: picturebox in execute

    Don't forget to use the Thread Tools menu to mark your thread Resolved, assuming that still works after the last upgrade.

  9. #9
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,013

    Re: picturebox in execute

    Quote Originally Posted by jmcilhinney View Post
    ... mark your thread Resolved, assuming that still works after the last upgrade.
    Well, they seem to have fixed some things, while new issues have popped up.
    But I haven't had a duplicate post, or the 30 second warning in days, if not a couple of weeks now, and the irritating google add at the bottom of the browser window seems to have been banned.
    "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

  10. #10
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,027

    Re: picturebox in execute

    Quote Originally Posted by passel View Post
    I haven't had a duplicate post, or the 30 second warning in days, if not a couple of weeks now
    I think that that's related tot he fact that the [HIGHLIGHT] tag no longer applies syntax highlighting. There appears to have been some incompatibility between the code that did that and newer vBulletin versions.

  11. #11
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,013

    Re: picturebox in execute

    Ahh...
    I don't use the HIGHLIGHT tag very often, so hadn't noticed... I guess we've probably hijacked the thread enough.
    "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

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