zoukankan      html  css  js  c++  java
  • Using System.Windows.Forms.OpenFileDialog

    The following example demonstrates

    • The use of the System.Windows.Forms.OpenFileDialog DotNetControl as alternative to the MAXScript GetOpenFileName..
    • The main advantage of the DotNet version is the ability to select multiple files at once.

    theDialog = dotNetObject "System.Windows.Forms.OpenFileDialog" --create a OpenFileDialog
    theDialog.title = "PLEASE Select One Or More Files" --set the title
    theDialog.Multiselect = true --allow multiple files to be selected
    theDialog.Filter = "HTML Files (*.html)|*.html|All Files (*.*)|*.*" --specify the filter
    theDialog.FilterIndex = 2 --set the filter drop-down list to All Files
    result = theDialog.showDialog() --display the dialog, get result into variable
    result.ToString() --when closed, convert the result to string
    result.Equals result.OK --returns TRUE if OK was pressed, FALSE otherwise
    result.Equals result.Cancel --returns TRUE if Cancel was pressed, FALSE otherwise
    theFilenames = theDialog.fileNames --the selected filenames will be returned as an array
  • 相关阅读:
    Examples
    Examples
    Examples
    Examples
    Examples
    Examples
    Examples
    Examples
    Examples
    如何把随机数或者对象添加到ArrayList集合
  • 原文地址:https://www.cnblogs.com/softimagewht/p/1784123.html
Copyright © 2011-2022 走看看