Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

TElFolderNameEdit make edit read only but button still launches folder dialog

Hi  Is there a way to make the control read only as far as the edit control is concerned but still allow the user to launch the folder dialog and select a folder?  I can't find an obvious way to do this...

Andy

Comments

  • 3 Comments sorted by Votes Date Added
  • I caanot reproduce this, maybe you use old ElPack version? And I see in source code that the ReadOnly property is checked before dialog execution:

    procedure TElFolderNameEdit.BtnClick(Sender: TObject);
    var
      frm: TCustomForm;
    begin
      if not ReadOnly then // <--------------
      begin
        FFileDlg.Folder      := Text;
        FFileDlg.DialogTitle := DialogTitle;
        FFileDlg.Parent      := GetParentForm(Self);

        TriggerBeforeDialogExecute(FFileDlg);

        if FFileDlg.ExecuteModal then
        begin
          Text     := FFileDlg.Folder;
          Modified := True;

          TriggerDialogExecute;

          frm := GetParentForm(Self);
          if frm <> nil then
            frm.BringToFront;
          Change;
        end;
      end;
    end;
  • Um, your code shows that the dialog will only launch if the control is NOT readonly, which is not what I want.

    I want it to launch even if the control IS readonly...

    In other words, there needs to be something like an EditReadOnly property to prevent the user typing into the edit box, but still be able to select a folder from the dialog...

    Andy
  • Sorry, I misunderstood your question. Unfortunately, as you can see, there no such possibility in current version.
Sign In or Register to comment.