Jump to content

Recommended Posts

Posted

Hi all,

I need some help with delphi.

I have 3 TLabels and a Tbutton on my application.

Tlabel1.Caption := 2;

Tlabel2.Caption := 4;

When I press the Tbutton, I want it to minus TLabel2.Caption from TLabel1.Caption, and display the output in Tlabel3.

TLabel1 and TLabel2 are not constants ie. they are the result of other maths equations.

Hope i didn't make it too confusing.

Thanks a lot!


Posted

Hi

to to minus TLabel2.Caption from TLabel1.Caption double click on Tbutton1 and write:

Label3.Caption := FloatToStr( StrToFloat( Label2.Caption ) - StrToFloat( Label1.Caption ) );

Posted

I was about to post that I resolved it already.

I used that code and saved it into a string variable because i still needed to manipulate the equations.

Thanks anyway.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...