GetFileDialogFilterIndex
Index = GetFileDialogFilterIndex()
 
Parameters: NONE
Returns:

    Index= returns the filter index. The first index is 1
 

     After the user has closed a SaveFileDialog or an OpenFileDialog you can call GetFileDialogFilterIndex to check which Filter Index they have chosen. You can save this value somewhere and set the same filter next time you display the dialog. Also with the SaveFileDialog the user expects the extension of the filter to be appendes to the filename unless no other extension is given with the filename.


  
; Inlcude the Dialogs library in this program
  #Include "PBDialogs2"
  
  
; Title Of the Dialog
  Title$="Change the Filter"
  
; Pre-seed the file name we're expecting to find
  Filename$="Some Cool FIle.txt"
  
  
  Filter$     ="(*.TXT)|*.TXT|(*BMP)|*.BMP"          ; Text files and Bitmap files
  
; Call the Save Dialog
  File$=SaveFileDialog(Title$,Filename$,Filter$)
  
  
; Check which filter index was selected
  Print "You selected filter number"
  Print GetFileDialogFilterIndex()
  
  
  // Display the screen & wait for a key press to end
  Sync
  WaitKey
  




 
Related Info: OpenFileDialog | SaveFileDialog :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com