get projectdirectory at designtime

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Meier

    #1

    get projectdirectory at designtime

    1. i have written a component that needs to read information from a file.

    2. the project that uses the component gives the file to to component via
    a property

    3. problem is, that this property must not be an absolut path but a
    relative one. at runtime this is no big problem, i expect the input file
    to be relative to the starting .exe whose path i get via
    Application.Sta rtupPath.
    but what about DesignTime? when i use my component in the designer it has
    the read the file too and i want its path relatively to the project
    directory. if i try to use Application.Sta rtupPath i get the path to the
    devenv.exe wich will not help. i cannot use an absolute path because the
    project must be opened at different machines.

    so the whole question is: how do i get the directory of the project
    containing my component


    --
    micha
Working...