My textbook says I need to make a donation program with three buttons, each representing a certain amount of money. The "Amount donated" should be shown on a label after I press a button.
For instance if I press the $10
button, it will say The total amount raised so far is $10
. And then if I press the $50
button, the label should caption The total amount raised so far is $60
. I'm in need of 3 buttons, a $10, $20
and $50
.
I don't even know where to start with the coding side!
Here's the starting code:
unit AIDSAWARENESS_U;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
btn10: TButton;
btn50: TButton;
btn20: TButton;
lblOutput: TLabel;
private
{private declarations}
public
{public declarations}
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
end.
If you wouldn't mind helping me, it would be much appreciated!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…