zoukankan      html  css  js  c++  java
  • 文件、文件夹、颜色对话框

     1   string defaultPath = @"C:\Users\Administrator\Desktop\";
     2         public string GetDirPath()
     3         {
     4             FolderBrowserDialog dialog = new FolderBrowserDialog();
     5             dialog.Description = "请选择小图片的文件夹";
     6             dialog.SelectedPath = defaultPath;
     7             if (dialog.ShowDialog() == DialogResult.OK)
     8             {
     9                 defaultPath = dialog.SelectedPath;
    10                 return dialog.SelectedPath;
    11             }
    12             return "";
    13         }
    14 
    15         public string GetFilePath()
    16         {
    17             OpenFileDialog ofd = new OpenFileDialog();
    18             ofd.Filter = "图片文件(*.jpg,*.gif,*.bmp)|*.jpg;*.gif;*.bmp";
    19             ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Templates);
    20             if (ofd.ShowDialog() == DialogResult.OK)
    21             {
    22                 return ofd.FileName;
    23             }
    24             return "";
    25 
    26         }
    27 
    28         public Color GetBgColor()
    29         {
    30             ColorDialog cd = new ColorDialog();
    31             cd.AllowFullOpen = true;
    32             cd.FullOpen = true;
    33             cd.ShowHelp = true;
    34             if (cd.ShowDialog() == DialogResult.OK)
    35             {
    36                 return cd.Color;
    37             }
    38             return Color.White;
    39         }
  • 相关阅读:
    flask-script插件
    狗书(flask基础)
    2018.1.18纪事
    py3.6 + xadmin的自学网站搭建
    使用selenium抓取淘宝的商品信息
    pyquery操作
    requests模块
    python3里的Urllib库
    随便写点
    How many ways?? HDU
  • 原文地址:https://www.cnblogs.com/lihui1030/p/3085720.html
Copyright © 2011-2022 走看看