var:
s:sting;
FileSetAttr(s,not faHidden);为什么复选框变灰了呢?
怎么才能不变灰?

解决方案 »

  1.   

    这个是你自己写的函数吧,WINAPI的标准函数叫SetFileAttributes,自己检查一下。
      

  2.   


    Sets the file attributes of a specified file.UnitSysUtilsCategoryfile management routinesfunction FileSetAttr(const FileName: string; Attr: Integer): Integer;DescriptionFileSetAttr sets the file attributes of the file given by FileName to the value given by Attr. The value of Attr is formed by combining the appropriate file attribute constants, as in the following: FileSetAttr('MyFile.sys', faReadOnly or faSysFile);FileSetAttr returns zero if the function was successful. Otherwise the return value is an error code.Note: See TSearchRec for a description of the file attribute constants. 
      

  3.   

    试试这样:
    { 去掉文件的隐藏属性 }
    FileSetAttr(FileName, (FileGetAttr(FileName) and (not faHidden)));
      

  4.   

    sysutils居然又有一个封装了的函数...