CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

哪位老兄能把MSDN中关于SaveFileDialog的讲解发给我一份,我的MSDN坏了,有急用。

楼主taoni(堕落天使)2001-07-25 12:28:10 在 VC/MFC / 基础类 提问

最好全一点,成员函数、变量等等。拜托了。 问题点数:30、回复次数:2Top

1 楼FireBow(狙击手)回复于 2001-07-25 13:02:25 得分 15

SaveFileDialog   Class  
   
  Encapsulates   the   Save   As   common   dialog   box   control   that   allows   the   user   to   specify   options   for   saving   a   file.    
   
  Component  
      |  
      +--CommonDialog  
          |  
          +--FileDialog  
              |  
              +--SaveFileDialog  
  package   com.ms.wfc.ui    
   
  public   class   SaveFileDialog    
  extends   FileDialog    
   
  Remarks  
   
  The   following   example   sets   options   for   a   Save   As   dialog   box,   displays   the   dialog   box,   and   stores   the   name   the   user   saved   the   file   under   in   a   variable:  
   
   
  private   void   btnSave_click(Object   source,   Event   e)  
  {  
  SaveFileDialog   sfd   =   new   SaveFileDialog();  
  sfd.setDefaultExt("java"); //sets   the   default   extension  
  sfd.setValidateNames(true);   //enables   name   validation  
  sfd.setCreatePrompt(true);     //prompts   the   user   to   create   the   file   if   it   doesn't   exist  
  sfd.setInitialDir("c:\\program   files");     //sets   the   initial   directory  
  int   dlgResult   =   sfd.showDialog();  
  if   (dlgResult   ==   DialogResult.OK)   {  
  String   fname   =   sfd.getFileName();   //gets   the   name   the   file   was   stored   under  
  MessageBox.show(fname);  
  }  
  }  
  /8----------------------------Methods   Description    
  getCreatePrompt   Retrieves   a   boolean   value   indicating   whether   the   dialog   box   prompts   the   user   for   permission   to   create   a   file   if   the   user   specifies   a   file   that   does   not   exist.    
     
  getOverwritePrompt   Retrieves   a   boolean   value   indicating   whether   the   Save   As   dialog   box   should   display   a   warning   if   the   user   specifies   a   file   name   that   already   exists.    
     
  reset   Resets   all   dialog   box   options   to   their   default   values.    
     
  setCreatePrompt   Sets   a   boolean   value   indicating   whether   the   dialog   box   prompts   the   user   for   permission   to   create   a   file   if   the   user   specifies   a   file   that   does   not   exist.    
     
  setOverwritePrompt   Sets   a   boolean   value   indicating   whether   the   Save   As   dialog   box   should   display   a   warning   if   the   user   specifies   a   file   name   that   already   exists.    
     
   
  够了吗?就怕你看不懂E   文  
  Top

2 楼FireBow(狙击手)回复于 2001-07-25 13:05:40 得分 15

SaveFileDialog.getCreatePrompt  
   
  Retrieves   a   boolean   value   indicating   whether   the   dialog   box   prompts   the   user   for   permission   to   create   a   file   if   the   user   specifies   a   file   that   does   not   exist.    
   
  Syntax  
   
  public   final   boolean   getCreatePrompt()  
   
  Return   Value  
   
  Returns   true   if   the   dialog   box   prompts   the   user   before   creating   a   file   if   the   user   specifies   a   file   name   that   does   not   exist;   returns   false   if   the   dialog   box   automatically   creates   the   new   file   without   prompting   the   user   for   permission.    
   
  See   Also       setCreatePrompt    
  /-----------------------------------------------------SaveFileDialog.getOverwritePrompt  
   
  Retrieves   a   boolean   value   indicating   whether   the   Save   As   dialog   box   should   display   a   warning   if   the   user   specifies   a   file   name   that   already   exists.    
   
  Syntax  
   
  public   final   boolean   getOverwritePrompt()  
   
  Return   Value  
   
  Returns   true   if   the   dialog   box   prompts   the   user   before   overwriting   an   existing   file   if   the   user   specifies   a   file   name   that   already   exists;   returns   false   if   the   dialog   box   automatically   overwrites   the   existing   file   without   prompting   the   user   for   permission.    
   
  Remarks  
   
  The   warning   allows   the   user   to   specify   whether   to   overwrite   the   existing   file.    
   
  /——————————————————————————————————————  
  SaveFileDialog.reset  
   
  Resets   all   dialog   box   options   to   their   default   values.    
   
  Syntax  
   
  public   void   reset()  
   
  Overrides       FileDialog.reset    
  /——————————————————————————————————  
  SaveFileDialog.setCreatePrompt  
   
  Sets   a   boolean   value   indicating   whether   the   dialog   box   prompts   the   user   for   permission   to   create   a   file   if   the   user   specifies   a   file   that   does   not   exist.    
   
  Syntax  
   
  public   final   void   setCreatePrompt(   boolean   value   )  
   
  Parameters  
   
  value    
   
  Set   to   true   if   the   dialog   box   prompts   the   user   before   creating   a   file   if   the   user   specifies   a   file   name   that   does   not   exist;   set   to   false   if   the   dialog   box   automatically   creates   the   new   file   without   prompting   the   user   for   permission.   The   default   value   is   false.   If   the   user   chooses   to   create   the   file,   the   dialog   box   closes   and   the   function   returns   the   specified   name;   otherwise,   the   dialog   box   remains   open.   The   validateNames   property   must   also   be   set   to   true   for   the   user   to   be   prompted   for   permission.  
   
  Remarks  
   
  For   a   code   example   using   this   method,   see   the   SaveFileDialog   control   topic  
  /——————————————————————————————————————  
  SaveFileDialog.setOverwritePrompt  
   
  Sets   a   boolean   value   indicating   whether   the   Save   As   dialog   box   should   display   a   warning   if   the   user   specifies   a   file   name   that   already   exists.    
   
  Syntax  
   
  public   final   void   setOverwritePrompt(   boolean   value   )  
   
  Parameters  
   
  value    
   
  Set   to   true   if   the   dialog   box   prompts   the   user   before   overwriting   an   existing   file   if   the   user   specifies   a   file   name   that   already   exists;   set   to   false   if   the   dialog   box   automatically   overwrites   the   existing   file   without   prompting   the   user   for   permission.   The   default   value   is   true.   If   the   user   chooses   to   overwrite   the   file,   the   dialog   box   closes;   otherwise,   the   dialog   box   remains   open.   The   validateNames   property   must   also   be   set   to   true   for   the   user   to   be   prompted   for   permission.  
   
  Remarks  
   
  The   warning   allows   the   user   to   choose   whether   to   overwrite   the   existing   file  
   
   
  Top

相关问题

  • 哪位老兄有aspnetmenu控件吗,最好是正式版的.很急用啊
  • 请问那位老兄知道何处有sql server 7.0下载,急用,在下有礼啦!!!在线等待。
  • 急用
  • 急用
  • 急用
  • 急用!!!!!
  • 急用!!
  • 急用!!!!!!
  • 各位老兄,向listview中新增一条记录后,怎样使焦点聚在最后一条记录上,小弟急用,先谢啦!!
  • 如何关闭窗口时触发执行数据库操作?各位老兄,我急用呢!!解决问题,一定给分!!

关键词

  • savefiledialog
  • dialog box
  • setcreateprompt
  • sfd
  • display a warning
  • prompts
  • whether
  • specifies
  • existing
  • save

得分解答快速导航

  • 帖主:taoni
  • FireBow
  • FireBow

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo