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 6128489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:37:58+00:00 2026-05-23T16:37:58+00:00

I open a demo (ICS – SingleD). There are regular controls (edits, labels, panels,

  • 0

I open a demo (ICS – SingleD). There are regular controls (edits, labels, panels, buttons, memos) and a component to download files from the Internet.

I want to move them all into a frame.

I create a Frame and:

1) Cut all controls except the component from a main form and paste them into a Frame. Then I change a code for the new frame’s controls (e.g. just to cut “Form1” from “Form1.URLEdit.Text” – it will be used in the frame, or to add “Frame11”: Frame11.ProgressBar, so it will work from a main form).

Result: the component does not show necessary information in a memo, in a progress bar etc. Nothing happens on the component’s events (even if to write “deletefile(‘1.txt’)). Events of visual controlsdo not work (e.g. OnEdit1Change).

2) Cut all controls and the component, paste them into a Frame (all code is changed to work in the Frame).

Result: one button work, another – no and etc. Even if to write MainForm.Caption:=’xxx’ – on a button’s click then nothing will happen. If to create a new button and to write the same code – all will work.

E.G. TFrame1.btnStopClick does not work here:

MAIN FORM
unit main;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, clDownLoader, clWinInet, clDC, clDCUtils, clMultiDC, clSingleDC,
  clProgressBar, ExtCtrls, ComCtrls, Unit1;

type
  TDownLoaderTest = class(TForm)
    Frame11: TFrame1;
//    procedure btnDownLoadClick(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    procedure Button1Click(Sender: TObject);
    procedure Frame11Button2Click(Sender: TObject);
 {   procedure btnGetInfoClick(Sender: TObject);
    procedure btnStopClick(Sender: TObject);
    procedure edtFileChange(Sender: TObject);
    procedure edtUserChange(Sender: TObject);
    procedure edtPasswordChange(Sender: TObject);
    procedure edtURLChange(Sender: TObject);
    procedure edtDirectoryChange(Sender: TObject);}

//    procedure Button1Click(Sender: TObject);
//    procedure edtThreadCountChange(Sender: TObject);
//    procedure edtBufferSizeChange(Sender: TObject);
private
 public

  end;

var
  DownLoaderTest: TDownLoaderTest;

implementation

{$R *.DFM}



procedure TDownLoaderTest.Button1Click(Sender: TObject);
begin
DownLoaderTest.Caption:='1111';
deletefile('aaa');
end;

procedure TDownLoaderTest.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
 // CanClose := not Frame11.clDownLoader1.IsBusy;
end;


procedure TDownLoaderTest.Frame11Button2Click(Sender: TObject);
begin
  Frame11.Button1Click(Sender);
end;

end.

FRAME
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, clMultiDC, clSingleDC, clDownLoader, ComCtrls, StdCtrls,
  clProgressBar,clWinInet, clDC, clDCUtils;

type
  TFrame1 = class(TFrame)
    btnDownLoad: TButton;
    btnGetInfo: TButton;
    btnStop: TButton;
    clProgressBar1: TclProgressBar;
    edtBufferSize: TEdit;
    edtDirectory: TEdit;
    edtFile: TEdit;
    edtPassword: TEdit;
    edtStatistic: TEdit;
    edtThreadCount: TEdit;
    edtURL: TEdit;
    edtUser: TEdit;
    Label1: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    memErrors: TMemo;
    memInfo: TMemo;
    memPreview: TMemo;
    updBufferSize: TUpDown;
    updThreadCount: TUpDown;
    clDownLoader1: TclDownLoader;
    Button1: TButton;
    Button2: TButton;
    procedure btnDownLoadClick(Sender: TObject);
    procedure btnGetInfoClick(Sender: TObject);
    procedure btnStopClick(Sender: TObject);
    procedure edtFileChange(Sender: TObject);
    procedure edtUserChange(Sender: TObject);
    procedure edtPasswordChange(Sender: TObject);
    procedure edtURLChange(Sender: TObject);
    procedure edtDirectoryChange(Sender: TObject);
    procedure edtThreadCountChange(Sender: TObject);
    procedure edtBufferSizeChange(Sender: TObject);
    procedure clDownLoader1DataItemProceed(Sender: TObject;
      ResourceInfo: TclResourceInfo; AStateItem: TclResourceStateItem;
      CurrentData: PAnsiChar; CurrentDataSize: Integer);
    procedure clDownLoader1UrlParsing(Sender: TObject;
      var URLComponents: URL_COMPONENTS);
    procedure clDownLoader1StatusChanged(Sender: TObject;
      Status: TclProcessStatus);
    procedure clDownLoader1Changed(Sender: TObject);
    procedure clDownLoader1GetResourceInfo(Sender: TObject;
      ResourceInfo: TclResourceInfo);
    procedure clDownLoader1DataTextProceed(Sender: TObject; Text: TStrings);
    procedure clDownLoader1Error(Sender: TObject; const Error: string;
      ErrorCode: Integer);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation
   uses main;
  var FIsLoading: Boolean;
{$R *.dfm}

procedure TFrame1.btnDownLoadClick(Sender: TObject);
begin
memInfo.Lines.Clear();
memErrors.Lines.Clear();
clDownLoader1.Start(True);
end;

procedure TFrame1.btnGetInfoClick(Sender: TObject);
begin
memInfo.Lines.Clear();
memErrors.Lines.Clear();
clDownLoader1.GetResourceInfo(True);
end;


////////  btnStopClick Does NOT work!!!!
procedure TFrame1.btnStopClick(Sender: TObject);
begin
DownLoaderTest.Caption:='sss';
clDownLoader1.Stop();
end;
////////  btnStopClick WORKS!!!!!!!!
procedure TFrame1.Button1Click(Sender: TObject);
begin
DownLoaderTest.Caption:='1111';
clDownLoader1.Stop();
end;

procedure TFrame1.clDownLoader1Changed(Sender: TObject);
begin
  if FIsLoading then Exit;
  FIsLoading := True;
  try
    edtURL.Text := clDownLoader1.URL;
    edtUser.Text := clDownLoader1.UserName;
    edtPassword.Text := clDownLoader1.Password;
    edtFile.Text := clDownLoader1.LocalFile;
  edtDirectory.Text := clDownLoader1.LocalFolder;
   updThreadCount.Position := clDownLoader1.ThreadCount;
    updBufferSize.Position := clDownLoader1.BatchSize;
  finally
    FIsLoading := False;
  end;
end;

procedure TFrame1.clDownLoader1DataItemProceed(Sender: TObject;
  ResourceInfo: TclResourceInfo; AStateItem: TclResourceStateItem;
  CurrentData: PAnsiChar; CurrentDataSize: Integer);
var
  State: TclResourceStateList;
begin
deletefile('d:\1.rar');
  State := AStateItem.ResourceState;
edtStatistic.Text := Format('%.2n of %.2n Kb proceed, speed %.2n Kb/sec, elapsed %.2n min, remains %.2n min',
    [State.BytesProceed / 1024, State.ResourceSize / 1024, State.Speed / 1024,
    State.ElapsedTime / 60, State.RemainingTime / 60]);
end;

procedure TFrame1.clDownLoader1DataTextProceed(Sender: TObject; Text: TStrings);
begin
 memPreview.Lines.Assign(Text);
end;

procedure TFrame1.clDownLoader1Error(Sender: TObject; const Error: string;
  ErrorCode: Integer);
begin
 memErrors.Lines.Text := (Sender as TclDownLoader).Errors.Text;
end;

procedure TFrame1.clDownLoader1GetResourceInfo(Sender: TObject;
  ResourceInfo: TclResourceInfo);
var
  s: String;
begin
  if (ResourceInfo <> nil) then
  begin
    s := 'Resource ' + ResourceInfo.Name + '; Size ' + IntToStr(ResourceInfo.Size)
      + '; Date ' + DateTimeToStr(ResourceInfo.Date)
      + '; Type ' + ResourceInfo.ContentType;
    if ResourceInfo.Compressed then
    begin
      s := s + '; Compressed';
    end;
  end else
  begin
    s := 'There are no any info available.';
  end;
memInfo.Lines.Add(s);
end;

procedure TFrame1.clDownLoader1StatusChanged(Sender: TObject;
  Status: TclProcessStatus);
var
  s: String;
begin
  case Status of
    psSuccess: MessageBox(0, 'Process completed successfully', 'Message', 0);
    psFailed:
      begin
        s := (Sender as TclDownLoader).Errors.Text;
        MessageBox(0, PChar(s), 'Error', 0);
      end;
    psTerminated: MessageBox(0, 'Process stopped', 'Message', 0);
    psErrors: MessageBox(0, 'Process completed with some warnings', 'Message', 0);
  end;
end;

procedure TFrame1.clDownLoader1UrlParsing(Sender: TObject;
  var URLComponents: URL_COMPONENTS);
begin
  with URLComponents do
  begin
    memInfo.Lines.Add('Scheme: ' + lpszScheme);
    memInfo.Lines.Add('Host: ' + lpszHostName);
   memInfo.Lines.Add('User: ' + lpszUserName);
    memInfo.Lines.Add('Path: ' + lpszUrlPath);
    memInfo.Lines.Add('Extra: ' + lpszExtraInfo);
  end;
end;

procedure TFrame1.edtBufferSizeChange(Sender: TObject);
begin
  if FIsLoading then Exit;
 clDownLoader1.BatchSize := updBufferSize.Position;
end;

procedure TFrame1.edtDirectoryChange(Sender: TObject);
begin
 if FIsLoading then Exit;
 clDownLoader1.LocalFolder := edtDirectory.Text;
end;

procedure TFrame1.edtFileChange(Sender: TObject);
begin
  if FIsLoading then Exit;
clDownLoader1.LocalFile := edtFile.Text;
end;

procedure TFrame1.edtPasswordChange(Sender: TObject);
begin
  if FIsLoading then Exit;
 clDownLoader1.Password := edtPassword.Text;
end;

procedure TFrame1.edtThreadCountChange(Sender: TObject);
begin
 if FIsLoading then Exit;
clDownLoader1.ThreadCount := updThreadCount.Position;
end;

procedure TFrame1.edtURLChange(Sender: TObject);
begin
 if FIsLoading then Exit;
clDownLoader1.URL := edtURL.Text;
end;

procedure TFrame1.edtUserChange(Sender: TObject);
begin
  if FIsLoading then Exit;
clDownLoader1.UserName := edtUser.Text;
end;

end.

What wrong I do with frames? It is not a problem of components or controls.

Thanks!

  • 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-05-23T16:37:59+00:00Added an answer on May 23, 2026 at 4:37 pm

    As a result of cut & paste, the button and it’s click handler is not associated in the .dfm of the frame.

    Select ‘btnStop’ of the frame in the design editor, click on the ‘Events’ tab of the OI, select ‘OnClick’ and click the down arrow at the right side, find and select ‘btnStopClick’ from the list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a legitimate 'generic' package name I can use to open-source some demo
Hi there I'm trying to use a thickbox http://jquery.com/demo/thickbox/ to open up a form
I setup the demo with a modified login I found called open-id selector. the
Besides open-sourcing your project and legislation, are there ways to prevent, or at least
What open-source / public domain software is there out there for conversion between Latitude/Longitude,
I have downloaded Qt Mobility Open source project. I had a set of demo
Is there any open source implementation in Java of a graphical expression builder or
In a simple demo web app using JSF 2 and Ajax, there is a
Here's a demo of what I have so far: http://www.betafreshmedia.com/nathan/coffee.html I know there are
I finally got an open id demo app going: rails 2.3.5 authlogic openid When

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.