Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8597831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:00:24+00:00 2026-06-12T01:00:24+00:00

My application should generate a random sum calculate the answer then put it in

  • 0

My application should generate a random sum calculate the answer then put it in a edit box on a panel and then the panel should move down and repeat (I have done all of this). OK the problem is while the panel is moving down nothing else works it is as if everything is disabled.

unit Unit5;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, jpeg, ExtCtrls, StdCtrls, math, Buttons;

type
  TForm1 = class(TForm)
    Image1: TImage;
    Panel1: TPanel;
    Edit1: TEdit;
    Panel6: TPanel;
    Shape1: TShape;
    Panel7: TPanel;
    Label1: TLabel;
    Edit6: TEdit;
    Label2: TLabel;
    Button1: TButton;
    Image5: TImage;
    Edit7: TEdit;
    Image2: TImage;
    Label3: TLabel;
    Timer1: TTimer;
    procedure FormActivate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Image2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
 var hori : integer;
     vert : integer;
     back : integer;
     value1 : integer;
     value2 : integer;
     answer : integer;
     star: integer;
     stranswer: string;
     k : integer;
{$R *.dfm}

procedure TForm1.FormActivate(Sender: TObject);
begin
 panel1.hide;
 panel7.Hide;
 back:=0;
 star:=0;
 end;

procedure TForm1.Button1Click(Sender: TObject);
begin
 stranswer:= inttostr(answer);
 if edit6.Text=stranswer then
 begin
  star:=star+1;
  edit7.text:=inttostr(star);

 end;
 button1.Caption:='Next';
 panel7.Show;
 edit6.SetFocus;
 panel1.show;
 randomize;
 hori:=random(840);
 value1:=random(10);
 value2:=random(10);
 panel1.Top:=0;
 panel1.Left:=hori;
 update;
 answer:=value1+value2;
 edit1.text:=('                '+inttostr(value1)+' + '+inttostr(value2));
 for k:= 1 to 512 do
  begin
   vert:= vert+1;
   panel1.Top:= vert;
   update;
   sleep(50)
  end;
end;

procedure TForm1.Image2Click(Sender: TObject);
begin
  back:=1;
  form5.Close;
  button1.show;
end;

end.

If you want I can send you a picture of the form.
If you can please help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:00:26+00:00Added an answer on June 12, 2026 at 1:00 am

    You move the panel down in 512 single pixel steps with a 50ms sleep in between each step. Since you don’t process any messages in that time, your app will be unresponsive for the 25s it takes to animate the panel. The program hangs because you have failed to service the message queue.

    The solution is to use a timer rather than a loop. In Button1Click you need to start the timer ticking.

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      .....
      StartPanelAnimation;
    end;
    
    procedure TForm1.StartPanelAnimation;
    begin
      Panel1.Top := 0;
      Timer1.Interval := 50;
      Timer1.Enabled := True;
    end;
    

    The timer procedure is like this:

    procedure TForm1.PanelAnimationTimerTimer(Sender: TObject);
    begin
      DoPanelAnimationStep;
      if PanelAnimationComplete then
        PanelAnimationTimer.Enabled := False;
    end;
    

    These functions would look like this:

    procedure TForm1.DoPanelAnimationStep;
    begin
      Panel1.Top := Panel1.Top+1;
    end;
    
    function TForm1.PanelAnimationComplete: Boolean;
    begin
      Result := Panel1.Top=512;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application, i want to generate 9 digit random numbers such that they
I am currently working on a web application which should generate an editable merged
My application should load some data when it start at first time, but it
Android application should show Events happening in city as per day/month/year anywhere in the
My application should be syncronized with a ServerDB to collect some Data all users
I know that a command line application should return 0 on success. But are
I know that the reminder application should display a badge or sound or kind
Consider an iPhone application that is a catalogue of animals. The application should allow
I'm trying to start unit testing on my application (should have done so from
I have created an SMS application in .NET. I wanted that the application should

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.