SaveDialog1.Filter := 'SML files (*.SML)|*.SML';

解决方案 »

  1.   

    SaveDialog1.Filter := 'SML files (*.SML)¦*.SML';
    SaveDialog1.DefaultExt:='SML';
      

  2.   

    To YOUFIY:
    不是我试过!
      

  3.   

      if SaveDialog1.Execute then
        Begin
          ChangeFileExt(SaveDialog1.FileName,'.sml');
          FileName:=SaveDialog1.FileName;
          ...
        end;
      

  4.   

    SaveDialog1.Filter := 'SML files (*.SML)¦*.SML';
    SaveDialog1.DefaultExt:='SML'; 
      

  5.   

    但是DELPHI5是這樣講的,GraphicExtension(TBitmap)是何意思?
    我可加分.詳細點.---------------------------------------------
    Specifies a default file extension.property DefaultExt: string;DescriptionDefaultExt specifies a file extension that is appended automatically to the selected file name, unless the selected file name already includes a registered extension. If the user selects a file name with an extension that is unregistered, DefaultExt is appended to the unregistered extension.Extensions longer than three characters are not supported. Do not include the period (.) that divides the file name and its extension.--------------------------------
    This code displays a Save Picture dialog box with the TBitmap default extension that is added automatically to files that are given no extension:SavePictureDialog1.DefaultExt := GraphicExtension(TBitmap);SavePictureDialog1.Filter := GraphicFilter(TBitmap);
    if SavePictureDialog1.Execute then
      {save the graphic }