Announcement

Collapse
No announcement yet.

Scrollbar in message window possible?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Scrollbar in message window possible?

    Hi @all!

    I'm working on a little tool that searches for temp files of a specific program with the option to delete them when found. For this I used the example of AMS' help section which works pretty good except for one thing: when a large amount of files is found the message window becomes to big to interact (cut off at the bottom of the screen).

    I used this example with a modification of the filetype (replaced Data.ini with ~*.*):

    Code:
    -- Gets the path to the user's My Documents folder.
    my_docs_path = Shell.GetFolder(SHF_MYDOCUMENTS);
    
    -- Check to see if the My Documents folder detection was successful.
    if (Application.GetLastError() == 0)then
    
        -- Search the user's My Documents folder for the file "Data.ini".
        search_results = File.Find(my_docs_path, "Data.ini", true, false, nil, nil);
    
        --Check to see if an error occurred during the search. If it did, display the error message.
        error = Application.GetLastError();
        if error ~= 0 then
            Dialog.Message("Error",_tblErrorMessages[error]);
        else
    
            -- If no files were found, notify the user.
            if (search_results == nil) then
                Dialog.Message("Notice", "Data.ini was not found in your My Documents folder.");
    
            -- If files were found, display a dialog containing a list of their locations.
            -- Also ask for deletion confirmation.
            else
                message = "Data.ini was found in the following location(s). Click OK to delete the file(s):\r\n\r\n";
                for index, path in pairs(search_results) do
                    message = String.Concat(message, path.."\r\n");
                end
                proceed = Dialog.Message("File Search Results", message, MB_OKCANCEL, MB_ICONQUESTION, MB_DEFBUTTON1);
    
                -- If the user clicked OK, delete all of the files found.
                if proceed == IDOK then
    
                    -- Delete each file found in the search.
                    for index, path in pairs(search_results) do
                        File.Delete(path, false, false, false, nil);
    
                        -- Check to see if any errors occurred during the deletion.
                        if (Application.GetLastError() ~= 0) then
                            Dialog.Message("Error", "The file located at: "..path.." could not be deleted.");
                        end
                    end
                end
            end
        end
    end
    Is there a way to add a scrollbar to the message window?

    Thx a lot in advance.

    Cheers

  • #2
    The most expedient solution would be to replace the Dialog with a DialogEx window. And then just embed a Paragraph object (with scrollbar feature enabled). Like this:
    .

    .
    With some minor tweaks to your code, the end result is the same.
    Example attached.
    Attached Files

    Comment


    • #3
      Thanks a lot - works as desired

      Comment

      Working...
      X