Building a Mailing List with Borland Delphi - Building the GUI for the Application
(Page 3 of 5 )
Start up Delphi and create a new application. Save the application with whatever name you like; I've called it MailinglistApp. Drop two 2 tedits (call them edfrom and edsubject), two memos, three tlistviews (rename them to lvattachments, lvGroups and lvgrpemails), one richedit (rename to re), two radio buttons (rename to rb1 and rb2), four static text labels (with captions: From, Subject, Attachments and Message), a tmainmenu, tidmessage (idmessage), idsmtp (rename to idsmtp), tadoquery, opendialog (rename to od), tdatasource and two buttons (rename to btnSend and btnBrowse). Double click on the mainmenu1 component and add the following captions:
File
|_Exit
Options
|_Add new contact
|_View all Email Addresses
Help
|_About
Now, double click on the exit menu item and add the following code:
procedure TForm1.Exit1Click(Sender: TObject);
begin
close;
end;
Next, double click on the Add New Contact menu item and add the following code:
procedure TForm1.AddNewContact1Click(Sender: TObject);
begin
form2.show;
end;
Next, double click on the View all Email Addresses menu item and add the following code:
procedure TForm1.ViewContactDetails1Click(Sender: TObject);
begin
form3.show;
end;
Click on the lvattachments listview, go to the object inspectors' viewstyle property ad select vsReport. Then just double click on it and add "Filename" as the column header. Do the same with lvgroups and add "group name" as the header. Also, do the same with lvgrpemail and add "Name" and "Email" as the headers.
Arrange these components on the form so that they look something like this:

That concludes the GUI building process.
Next: How the program works >>
More Delphi-Kylix Articles
More By Leidago