[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

Simple way to input a number

I have a component inherited from TImage for which a popup menu is created dynamically. On that popup menu is an option to enter a number (between 1 and 100 inclusive).

How can I get this input from the user at runtime. I don't particularly want to create a form outside of the component that I am developing.

Is there a simple, built-in way to get a single entry from the user or do I need to create a form on the fly?

Thanks
0
zebada
Asked:
zebada
1 Solution
 
intheCommented:
hi ,
you can use InputQuery() api:

example:

procedure TForm1.Button2Click(Sender: TObject);
var
   N:string;
   nOk:boolean;
 begin
   nOk:= InputQuery('hello',
      'whats your name?', N);

   if nOk
     then ShowMessage('your name is,'+N)
     else ShowMessage('nothing entered');
 end;

Regards Barry
0
 
zebadaAuthor Commented:
I like perfect answers.
Cheers
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now