如题,假设打开对话框的NAME是OD,路径是MyPath:string,应怎样做???

解决方案 »

  1.   

    nitialDir determines the default directory displayed in the file-selection dialog when it opens. For example, to point the dialog at the WINDOWS\SYSTEM directory, set the value of InitialDir to C:\WINDOWS\SYSTEM.If no value is assigned to InitialDir, or if the specified directory does not exist, the initial directory is controlled by the global ForceCurrentDirectory variable. If ForceCurrentDirectory is true, the dialog opens with the current working directory displayed. Otherwise, the dialog opens with either the current working directory or the My Documents directory, depending on the version of Windows.
      

  2.   

    我曾把InitialDir设成C:\,但不行
      

  3.   

    你要什么东东指向你的路径?
    listbox?
    dirbox?
    这些是有directory的属性
    其它的嘛
    也想不出有什么要关联路径的
      

  4.   

    OpenDialog,在设计期中把InitialDir设成C:\,按F9编绎并打开后竟还是“我的文档”,再按F9,就可打开C:\这个文件夹了,怎么会这样????
      

  5.   

    formshow/隨便放在一個地方,打開之前執行這個就行了
    OpenDialog1.InitialDir := '....'
      

  6.   


    ../   表示为上一级目录
    .     表示当前程序所在的目录
    OpenDialog1.InitialDir:='.';   
    OpenDialog1.Execute;
      

  7.   

    OpenDialog1.InitialDir:=ExtractFilePath(Application.ExeName );