Image.FromFile() offset from app root

Posted on 2014-08-22
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:charlesbaldo
    LVL 74

    Accepted Solution

    .Image = Image.FromFile(Server.MapPath("~\Images\RedCircle.png")...

    Open in new window


    Author Closing Comment

    Thank You

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    This video discusses moving either the default database or any database to a new volume.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now