DialogBox

In an OpenDialog box how can I specify different action for the open and close buttons? it is doing the same action for both

Comments

  • : In an OpenDialog box how can I specify different action for the open and close buttons? it is doing the same action for both
    See http://codepedia.com/1/CppBuilderMessageDlg ...
    Good luck,

    bilderbikkel

  • : : In an OpenDialog box how can I specify different action for the open and close buttons? it is doing the same action for both
    : See http://codepedia.com/1/CppBuilderMessageDlg ...
    : Good luck,
    :
    : bilderbikkel
    :
    :Hi,
    These are for message boxes. But what about the specific OpenDialog box? It only has 2 buttons(Open and Cancel).
  • : : : In an OpenDialog box how can I specify different action for the open and close buttons? it is doing the same action for both
    : : See http://codepedia.com/1/CppBuilderMessageDlg ...
    : : Good luck,
    : :
    : : bilderbikkel
    : :
    : :Hi,
    : These are for message boxes. But what about the specific OpenDialog box? It only has 2 buttons(Open and Cancel).
    :
    Oops, I'm sorry... The function OpenDialog::Execute() returns a value, depending on what the user did. Check its help to find out.

    Good luck,
    bilderbikkel

  • : : : : In an OpenDialog box how can I specify different action for the open and close buttons? it is doing the same action for both
    : : : See http://codepedia.com/1/CppBuilderMessageDlg ...
    : : : Good luck,
    : : :
    : : : bilderbikkel
    : : :
    : : :Hi,
    : : These are for message boxes. But what about the specific OpenDialog box? It only has 2 buttons(Open and Cancel).
    : :
    : Oops, I'm sorry... The function OpenDialog::Execute() returns a value, depending on what the user did. Check its help to find out.
    :
    : Good luck,
    : bilderbikkel
    :
    : Hi,
    I have not understood your reply.
    Does OpenDialog->Execute() returns true or false?
    But it will always be true, whether the user presses open or cancel, since the dialog box has been opened(executed).


  • : I have not understood your reply.
    : Does OpenDialog->Execute() returns true or false?
    : But it will always be true, whether the user presses open or cancel, since the dialog box has been opened(executed).

    Read the Help (type 'OpenDialog1->Execute', set cursor on OpenDialog1 and press F1, select the Method Execute)(I copy-pasted it):

    [code]
    VCL Reference
    TOpenDialog::Execute

    TOpenDialog See also Example

    Displays the file-selection dialog.

    virtual bool __fastcall Execute(void);

    Description

    Execute opens the file-selection dialog, returning true when the user selects a file and clicks Open. If the user clicks Cancel, Execute returns false.

    if (OpenDialog1->Execute())

    Memo1->Lines->LoadFromFile(OpenDialog1->FileName);
    else

    Memo1->Clear();
    [/code]

    Read it next time,
    bilderbikkel

  • : : I have not understood your reply.
    : : Does OpenDialog->Execute() returns true or false?
    : : But it will always be true, whether the user presses open or cancel, since the dialog box has been opened(executed).
    :
    : Read the Help (type 'OpenDialog1->Execute', set cursor on OpenDialog1 and press F1, select the Method Execute)(I copy-pasted it):
    :
    : [code]
    : VCL Reference
    : TOpenDialog::Execute
    :
    : TOpenDialog See also Example
    :
    : Displays the file-selection dialog.
    :
    : virtual bool __fastcall Execute(void);
    :
    : Description
    :
    : Execute opens the file-selection dialog, returning true when the user selects a file and clicks Open. If the user clicks Cancel, Execute returns false.
    :
    : if (OpenDialog1->Execute())
    :
    : Memo1->Lines->LoadFromFile(OpenDialog1->FileName);
    : else
    :
    : Memo1->Clear();
    : [/code]
    :
    : Read it next time,
    : bilderbikkel
    :
    : Hi!!!
    Sorry I was confused and missed some of the things.
    Anyway thanks very much for your help.

Sign In or Register to comment.

Howdy, Stranger!

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

Categories