Solved

How to get user input

Posted on 1998-07-08
2
213 Views
Last Modified: 2010-04-04
I want to use inputbox to get user information
how can i ?
i´m using Delphi 3.02
0
Comment
Question by:vis
2 Comments
 
LVL 1

Accepted Solution

by:
Marcius earned 30 total points
ID: 1357304
function InputBox(const ACaption, APrompt, ADefault: string): string;

Example:

MyUserDate := InputBox('Login To Server','Username: ','');

This will prompt the user and allow them to enter some data. Once they press the OK button, the function will return to the calling program and your variable will contain the data.
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1357305
or use InputQuery, From Delphi Help file:

This example uses a button and a label on the form. When the user clicks the button, the input box displays. If the user chooses OK, the string that appears in the edit box of the dialog box displays as the caption of the label on the form. If the user chooses Cancel, the dialog box closes and the caption of the label remains unchanged.

procedure TForm1.Button1Click(Sender: TObject);

var
  NewString: string;
  ClickedOK: Boolean;
begin
  NewString := 'Default String';
  Label1.Caption := NewString;
  ClickedOK := InputQuery('Input Box', 'Prompt', NewString);
  if ClickedOK then                 { NewString contains new input string }
    Label1.Caption := 'The new string is ''' + NewString + '''';
end;
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Send message from delphi to whatsapp, is it possible? 3 1,149
Delphi selector screen 2 69
Working with hours 3 46
Delphi: Connect to running MS Outlook 4 47
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now