Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Max number of controls on a delphi form

Posted on 2003-03-03
4
Medium Priority
?
255 Views
Last Modified: 2010-04-04
Hi

Visual Basic has a max of 256 controls per form.
Am wondering what if any are the limits for Delphi.

Regards
LostInSpace
0
Comment
Question by:LostInSpace2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:ILE
ID: 8061378
i think there is no practical limit



here is a example who create dinamicly 10.000 buttons on the form and

procedure TForm1.BitBtn1Click(Sender: TObject);
var b:tbutton;
    i:integer;

begin
    for i:=0 to 10000 do
      begin
        b:=tbutton.create(form1);

        b.parent:=form1;

         if i mod 100= 0 then form1.Caption:=inttostr(i);
      end;
end;



litle slow to execute (after first 2000-3000 buttons
but wery goood example for our collegs VB-EXPERTS

:))


0
 
LVL 17

Expert Comment

by:geobul
ID: 8062937
Hi,

There is an OS limit for GDI resourses which is different among Windows versions. For example, Win2000/XP can handle more resources than Win9x. Each TWinControl descendant occupies such a resource.

Regards, Geo
0
 
LVL 1

Expert Comment

by:TAZI
ID: 8062958
Hi ..

There is some sort of minor problem ....

I've written a huge system and I toggele between notebook pages. All on 1 Form - I've now intergrated Dialler Technology into the program and experience unending problems.  At some stage, all breakpoints were ignored and the application refused to break for debugging purposes.  Further to this, The program just acted up ... I hand major problems and eventually reverted to an old backup copy.  I then moved certain controls off the form to a new form (All popup date calendars and Message Dialog Boxes)

I have note made use of standard dialog boxes.  I've coded my own popups to fit in with the look and feel of the system.

I then re-coded the dialler technology most of the development on a new form.  Certain aspects and controls needed to be on the main form.  But I haven't had a problem eversince.

So there is some sort of minor problem ... I can't quite tell you exactly how many controls.

I will try counting the number of controls on the form and post it onto this site

Hope this information is useful
Regards
TAZI
0
 
LVL 17

Accepted Solution

by:
geobul earned 150 total points
ID: 8062996
ComponentCount and ControlCount properties of TForm are of integer type. So, there is a limit of 2147483647 components that can be placed on a form ;-)

Regards, Geo
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Loops Section Overview
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question