Topic: MessageBox with input txt

hello all

how can i make a MessageBox  with input txt and YesNo buttons

Yes ===>  if input txt = '123'  then any code here

No  ===> Return


thanks for help

Re: MessageBox with input txt

kofa wrote:

hello all

how can i make a MessageBox  with input txt and YesNo buttons

Yes ===>  if input txt = '123'  then any code here

No  ===> Return


thanks for help

try this.

var t : String;
begin
    t := inputbox('Hello', 'Title', 'default');
    showmessage(t);
end;
brian

Re: MessageBox with input txt

hello brian.zaballa

thank you very much

but when i press No button i see message box too

i want if i press yes and input text = 123 then showmessage
else if i press No button then cancel

thanks for help

Re: MessageBox with input txt

i used this code

var t : String;
begin
    t := inputbox('Hello', 'Title', 'default');
    if t ='123' then showmessage(correct)
    else if t <>'123' then showmessage('wrong');
end;

but when i press No or    X (close)  showmessage('wrong') appeared too

can you help me

5 (edited by brian.zaballa 2020-12-30 09:49:16)

Re: MessageBox with input txt

kofa wrote:

i used this code

var t : String;
begin
    t := inputbox('Hello', 'Title', 'default');
    if t ='123' then showmessage(correct)
    else if t <>'123' then showmessage('wrong');
end;

but when i press No or    X (close)  showmessage('wrong') appeared too

can you help me

maybe this will fix it

var
    d : String = 'Default Value';
    t : String;
begin
    t := inputbox('Hello', 'Title', d);
    if ((t ='123')) then showmessage('correct')
    else if ((t <>'123') and (t <>d)) then showmessage('wrong')
end;

but this will not also show any message when default value is entered

brian

Re: MessageBox with input txt

very good brian.zaballa

is it possible to change input direction to right to left and input position

In other words, how can i make the word (Title ) to the right and the input to the left

thanks for help

Re: MessageBox with input txt

kofa wrote:

very good brian.zaballa

is it possible to change input direction to right to left and input position

In other words, how can i make the word (Title ) to the right and the input to the left

thanks for help

I think it cannot be done for that inputbox is a delphi/pascal's function to begin with. If you really want, you can create your own dialog using form and components.

brian

Re: MessageBox with input txt

thanks for advance