Toon posts:

[Delphi] InputBox *

Pagina: 1
Acties:

Verwijderd

Topicstarter
ik heb hier al gezocht en ene kleine oplossing gevonden voor mijn probleem maar ik vraag me af of het niet gemakkelijker kan.

Ik gebruik de functie inputbox om een string toe te kennen aan een bepaalde variable.

Nu kan je nadat je de string hebt ingevoerd op OK en Cancel klikken.

Wanneer men nu op cancel klikt wil ik niet dat de actie verder uitgevoerd uitgewoord.

Nu controleer ik de lengte van de ingevoerde string maar ik vraag me dus af of het niet gewoon af te vangen is wanneer men op Cancel klikt.

Of wanneer men dus op OK klikt.

  • whoami
  • Registratie: December 2000
  • Laatst online: 22:54
Uit de Delphi help:
Call InputBox to bring up an input dialog box ready for the user to enter a string in its edit box. The ACaption parameter is the caption of the dialog box, the APrompt parameter is the text that prompts the user to enter input in the edit box, and the ADefault parameter is the string that appears in the edit box when the dialog box first appears.

If the user chooses the Cancel button, InputBox returns the default string. If the user chooses the OK button, InputBox returns the string in the edit box.

Use the InputBox function when there is a default value that should be used when the user chooses the Cancel button (or presses Esc) to exit the dialog. If the application needs to know whether the user chooses OK or Cancel, use the InputQuery function instead.
InputQuery gebruiken dus. (Als je er ff in gekeken had, dan had je het zelf ook wel gevonden).

https://fgheysels.github.io/