Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you control Windows dialog box scroll position?

Status
Not open for further replies.

LEICJDN1

Technical User
Nov 27, 2002
201
GB
I need to load over 1000 images for analysis on turn. All in the same directory on CD. Use OpenPictureDialog to load image.

Is there anyway to force the dialog box to autoscroll to a certain point in the list (i.e. the last one chosen) to save me having to click the scroll bar 15 times or drag the bar across.

Or alternatively resize the whol dialog box so more can be seen on screen at once and hence reduce scrolling?

Small point I know but would save me hours!!

Thanks.
 
Sorry to double post but another thought:

Would it be possible to define the file path and intial file name by choosing the first file, then have the app auto load the file 'next' in the directory in that file path, therfore negating need for repeated openpicture dialog calls?

Thanks!
 
In the words of the help page (D4):-
"To make a file name appear by default in the dialog’s edit box, assign a value to FileName in the Object Inspector or in program code."
You should also set InitialDir to ensure the correct directory is selected.
If you want to select files automatically, use FindFirst and FindNext - I find they work well.
 
Thanks Dooda.

I will try sending the last used name back to the openpicturedialog to see if that updates the scrolled window and speeds up finding and selecting the next file.

How can I apply Findnext to the openpicturedialog? I do not import a list of files, I just open the directory they are in and the Windows dialog displays them. How can I load a list of files from a directory, and then findnext?
 
Hi,

Have added a filelistbox, and read the path from the initial opening of a file.
So, now I have a filelistbox full of all the files in that directory that need analysing.

How can I get the 'location' of the current file in that list, and then use that to set what the next file to anlayse is (i.e. location+1 unless =filelist.count)
so i can then send that filename to openpicturedialog and open the next file?

I will not analyse all files at once so need to know where to carry on from. On exit the last file analysed will be stored in an ini file and read in on create to allow me to carry on where I left off.

Thanks for any help given.
 
FileListBox.Items[FileListBox.ItemIndex] will retrieve the current item. ItemIndex keeps track of the selected item. Clive [infinity]
Ex nihilo, nihil fit (Out of nothing, nothing comes)
 
In answer to accessing the next file, simply increment FileListBox.ItemIndex:
Code:
 Inc(FileListBox.ItemIndex);

Hope this helps Clive [infinity]
Ex nihilo, nihil fit (Out of nothing, nothing comes)
 
Superb! Now I can fully automate the file selection procedure.

Your help is much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top