FAQ & Knowledge Base

Welcome to our Knowledge Base. Search or browse through the topics below to find answers to your questions.

Categories: ShellBrowser Delphi Components | Show all categories

Prevent File Open in TJamExplorerBrowser

Question / Problem

How can I prevent a file from being opened in the TJamExplorerBrowser?

Answer / Solution

To block opening in general, simply implement an empty event handler for the OnDefaultAction event of the TJamExplorerBrowser control that contains only the code "exit;".

You may also do this conditionally:

  if JamExplorerBrowser1.SelectedFiles[0].EndsWith('.log', True) then
    exit
  else
    JamExplorerBrowser1.InvokeCommand('')