Friday, October 5, 2007

How to run the program

How to run the program

To run the program

Step 1

To run the program, first, you need to press the F9 to run the program.

Step 2

  1. Open file is functioning to open the file.

  2. Font is functioning to change the Font type.

  3. Save File is functioning to save the file

Edited By: Norasyikin Mahmud

© 2001 ISC

All rights reserved. All other product names and trademarks are registered properties of their respective owners.

301001

How to program with the SaveDialog

How to program with the SaveDialog

To program with the SaveDialog

Step 1

To program with SaveDialog, first, double click the Save File button.

Step 2

Next, it will display a Code Explore window and you need to enter the programming inside it.

Step 3

Program:

procedure TForm1.SaveAs1Click(Sender:TObject);

begin

savedialog1.filename:=tFilename;

if SaveDialog1.Execute then

Begin

tFilename:=SaveDialog1.Filename;

Caption:=ExtractFileName(tFilename);

SaveFileClick(sender);

end;

end;

procedure TForm1.SaveFileClick(Sender: TObject);

begin

if OpenDialog1.FileName <> '' then

Begin

Memo1.Lines.SaveToFile(OpenDialog1.Filename);

End

else

SaveAs1Click(sender)

end;

end.

Tips:

and

How to work with SaveDialog

How to work with SaveDialog

To work with SaveDialog

Step 1

To work with SaveDialog, first, you need to add the Button and SaveDialog in the Form.

The Button1 properties is Name: SaveFile, Caption: Save File.

Step 2

Example:

In the SaveDialog properties click the Filter

In the Filter Editor type int.

->

How to work with FontDialog

How to work with FontDialog

To work with FontDialog

Step 1

If you wish to work with FrontDialog, first you need to add the Button and OpenDialog in the Form. The Button1 properties is Name: Set Font, Caption: Font.

Example:

Step 2

Next, you have to double click the Font button and it will display a Code Explore window. Later, enter the programming inside it.

Step 3

Program:

procedure TForm1.SetFontClick(Sender: TObject);

begin

FontDialog1.Font:=Memo1.Font;

if FontDialog1.Execute then

Memo1.Font:=FontDialog1.Font;

end;

end.

How to do programming with the OpenDialog

How to do programming with the OpenDialog

To do programming with the OpenDialog

Step 1

To do programming with the OpenDialog, first, you need to double click the Open File button.

Step 2

After that, it will display a Code Explore window and you just need to enter the programming inside it.

Step 3

Program:

procedure TForm1.FileOpenClick(Sender: TObject);

begin

with OpenDialog1 do

if Execute then

Begin

Memo1.Lines.LoadFromFile(FileName);

Caption:='Open the File'

+ExtractFilename(FileName);

End;

end;

end.

How to work with the OpenDialog

How to work with the OpenDialog

To work with the OpenDialog

Step 1

To work with the OpenDialog, the first thing you need to do is to add the Button, Memo and OpenDialog in the Form. The Button1 properties is Name: FileOpen, Caption: Open File.

Example:

Step 2

Next, in the OpenDialog properties, you need to click the Filter option and in the Filter Editor type int.

How to set the device of the FontDialog

How to set the device of the FontDialog

To set the device of the FontDialog

Step 1

To set the device of the FrontDialog, first, you need to move the mouse to the Dialog object toolbar and then select the FontDialog object that you want to add in the form.

Step 2

Next, the FontDialog object is added in the form.

Step 3

After that, you have to move the mouse to the Object Inspector window and find the Device in the Properties tab. Finally, enter the new title.


How to set the Title of the SaveDialog

How to set the Title of the SaveDialog

To set the Title of the SaveDialog

Step 1

To set the title of the SaveDialog, first move the mouse to the Dialog object toolbar and then select the SaveDialog object you want to add in the form.

Step 2

Next, you抣l see that the SaveDialog object is being added in the form.

Step 3

After that, you need to move the mouse to the Object Inspector window and then find the Title in the Properties tab. Finally, enter the new title.

->

How to set the InitialDir of the SaveDialog

How to set the InitialDir of the SaveDialog

To set the InitialDir of the SaveDialog

Step 1

If you would like to InitialDir of the SaveDialog, first, move the mouse to the Dialog object toolbar and then select the SaveDialog object you want to add in the form.

Step 2

Now, you抣l see that the SaveDialog object is being added in the form.

Step 3

Next, you need to move the mouse to the Object Inspector window and find the InitialDir in the Properties tab. Finally, enter the directories name. Example c:\My Documents.

->

How to set the Filter in the OpenDialog

How to set the Filter in the OpenDialog

To set the Filter in the OpenDialog

Step 1

To set the filter in the OpenDialog, first move the mouse to the Dialog object toolbar and then select the OpenDialog object that you want to add in the form.

Step 2

Now, you抣l see that The OpenDialog object is being added in the form.

Step 3

Later, move the mouse to the Object Inspector window and then find the Filter in the properties tab. Finally, enter the filter name and filter.

->

How to set the DefaultExt in the open dialog object

How to set the DefaultExt in the open dialog object

To set the DefaultExt in the open dialog object

Step 1

To set DefaultExt in the open dialog object, first move the mouse to the Dialog object toolbar and then select the OpenDialog object you want to add in the form.

Step 2

Next, you抣l see the OpenDialog object is being added in the form.

Step 3

After that, you need to move the mouse to the Object Inspector window and then find the DefaultExt in the Properties tab.

When you want to open the file the system will automatically add external name the .DOC. Example file.DOC

How to work with InputBox

How to work with InputBox

To work with InputBox

Step 1

To work with InputBox, first, add the Button object in the form.

Step 2

Then, double click the Button and it will display a Code Explore window. Next, you need to enter the programming inside it.

Step 3

Program:

procedure TForm1.Button1Click(Sender: TObject);

begin

InputBox('Name','Please enter your name','|');

end;

end.

You can try to press the F9 to run the program to see the result.

How to work with MessageDlg command

How to work with MessageDlg command

To work with MessageDlg command

Step 1

To work with MessageDlg command, first add the Button object in the form.

Step 2

After that, double click the Button and it will display a Code Explore window and then enter the programming inside it.

Step 3

Program:

procedure TForm1.Button1Click(Sender: TObject);

begin

MessageDlg('The document is modify, you want to save it'

,mtConfirmation,mbYesNoCancel,0);

end;

end.

Step 4

Now, you can try to press the F9 to run the program to see the result.

How to show the Message box

How to show the Message box

To show the Message box

Step 1

To show the message box, the first thing you must do is to add the Button object in the form.

Step 2

Then, double click the Button and it will display a Code Explore window later, you need to enter the programming inside it.

Step 3

Program:

procedure TForm1.Button1Click(Sender: TObject);

begin

ShowMessage('Hello Everybody');

end;

end.

You can try to press the F9 to run the program to see the result.

How to set the alignment of the image object

How to set the alignment of the image object

To set the alignment of the image object

Step 1

To set the alignment of the image object, first, move the mouse to the Additional object toolbar and after that, select the Image object you want to add in the form.

Step 2

Next, you will see that the Image object is being added in the form.

Step 3

Later, move the mouse to the Object Inspector window and then find the Center in the Properties tab. Finally, you need to select the True or False in the Center list box.

->

How to insert the picture of the image object

How to insert the picture of the image object

To insert the picture of the image object

Step 1

To insert the picture of the image object, first you need to move the mouse to the Additional object toolbar and then select the Image object that you want to add in the form.

Step 2

Next, you抣l see that the Image object is being added in the form.

Step 3

After that, move the mouse to the Object Inspector window and find the Picture in the Properties tab. Finally, you can see that the picture is loading.

->