Image.FromFile() offset from app root

Posted on 2014-08-22
Medium Priority
Last Modified: 2014-08-25
I have a ToolStripMenuItem that I want to add a image from in the /images folder directly above.  I want it offset from the execution path

          With .Items.Add("Add")
                    .Name = "Edit.Exe"
                    .ForeColor = Color.Yellow
                    .BackColor = Color.Red
                    .TextAlign = ContentAlignment.MiddleRight
                    .Image = Image.FromFile("~\Images\RedCircle.png" <<<<<<<<-- Causes Error
                End With

How do I reference the file?
Question by:Charles Baldo
LVL 75

Accepted Solution

käµfm³d   👽 earned 2000 total points
ID: 40280055
.Image = Image.FromFile(Server.MapPath("~\Images\RedCircle.png")...

Open in new window


Author Closing Comment

by:Charles Baldo
ID: 40283708
Thank You

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question