Optionally, you can set the Glyph property of TBitBtns and Icon property of TTrayIcon. Set BalloonHint to Alarm and Visible to True for TrayIcon1. Set Font -> Size property of lblTime to 24. Set MultiSelect property of lstAlarms to True to allow selecting multiple items and remove them at once. Set AutoSize property to False and Alignment to taCenter for TLabels, then resize them to same size. Set Caption property of TLabels and TBitBtns according to screenshot. Set Name of the second TLabel to lblTime and the third one to lblDate. Set the Name property of the TListBox to lstAlarms, one TBitButton to btnAdd and another to btnRemove. That’s why we’ll be making an advanced version of an alarm clock next… TutorialĬreate a new Application project ( Project - New Project - Application - OK).ĭraw TLabel, TListBox, TBitBtn (from Additional tab), TTrayIcon (from Additional tab), TTimer (from System tab) components like the screenshot below: After you click OK the program will close itself.īut it would be nice if we could have multiple alarms and inputs could be little easier. It should show a message when it hits the time you entered. Be cautious to follow the exact format (HH-MM am/pm). Now press F9 (or Run - Run) and input a time for your alarm. If Edit1.Text = Label1.Caption then begin Label1.Caption := FormatDateTime( 'hh:nn am/pm', Time) In this case two TLabels for “Time now:” and “Alarm time:” are what you’d want to create. Let them take any name that comes in automatically. Then draw as many TLabels as you want to indicate what element does which. You can also set Project - Project Options - Project Options - Application Settings - Title to Simple Alarm. Optionally, set Caption property of Form1 to something like “ Simple Alarm“. Empty Text property of Edit1 and set -:- as Caption of Label1. They’ll probably be named Label1, Edit1 and Timer1 consecutively. Just draw a TLabel, a TEdit and a TTimer (from System tab). So let’s get our hands dirty with a simple version of the alarm… Basic TutorialĬreate a new Program project ( Project - New Project - Application - OK).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |