Home > Back-end >  Dynamically create 300 container, but starting in 203 after the position overlap, why?
Dynamically create 300 container, but starting in 203 after the position overlap, why?

Time:09-29

For I:=0 to 207 do
The begin
TPanel. Create (Self). Name:='MyPanel' + IntToStr (I);
With TPanel (FindComponent (' MyPanel + IntToStr (I))) do
The begin
Parent:=Form1;
Left:=10;
Top:=I * 160 + 30;
Width:=60;
end;
end;

After 203, the position of the panel is wrong, why ah... Used in the

CodePudding user response:

Is too big, 160 * 203 + 30=32510, estimation and about 32768,

CodePudding user response:



But the key to the new panel, top high value can also be built, very confusing

CodePudding user response:

1/f, reasonable, may cross a line,

CodePudding user response:

So how to solve? I probably to build about 1000... Put scrollbox, in the same way

CodePudding user response:


Do you have any requirements must be built around 1000
Top:=I * 160 + 30; This value is so big in the interface can't see anyway, a few less, need to create the corresponding display

CodePudding user response:

In the building of a dynamic, mouse don't go to anything, can't interference, don't move to see, I like you build 850 image do not have what matter

CodePudding user response:

In the build process using the mouse a interference can appear what you say, position disorder

CodePudding user response:

Is made of paper, do not want to make a screen is only a problem, is the form I create the exam answer when displayed, and then do while towing line, 200 questions is not a screen, and then the next page then create 200 questions?

CodePudding user response:

Is such a design ah you just create a screen can show how many, how many,

CodePudding user response:

I have a scroll bar, like, paper, while doing, we can see the front, is primarily used as practice questions, is not a test, two columns around for a while back and I will try to make it, can't break through the height limit?

CodePudding user response:

Tried didn't find a way to break through 32767, you do flip effect

CodePudding user response:

What do you mean use pagecontrol?
Because is used to make the topic review, so as long as open software, done in front of the problem is to keep the viewing and use this to set a lot of containers in,
The interface to full screen display, automatic to adapt to the screen

CodePudding user response:

I think you have a problem of code or inefficient
For I:=0 to 207 do
The begin
TPanel. Create (Self). Name:='MyPanel' + IntToStr (I);
With TPanel (FindComponent (' MyPanel + IntToStr (I))) do
The begin
Parent:=Form1;
Left:=10;
Top:=I * 160 + 30;
Width:=60;
end;
end;
 
Var PNL: TPanel;
For I:=0 to 207 do
The begin
PNL TPanel. Create (Self);
PNL. Name:='MyPanel + IntToStr (I);
With PNL do
The begin
Parent:=Form1;
Left:=10;
Top:=I * 160 + 30;
Width:=60;
end;
end;

Try to this, you use findcomponent will degrade the performance of the program, may lead to the error here

CodePudding user response:

The fourth line of code is wrong you couldn't make the change on the keyboard

CodePudding user response:

If there is a scroll bar, the Top and Left calculation, need to add the Position of the scroll bar

CodePudding user response:

Make it flip it,

CodePudding user response:

Paging do, set a number of pages,
  • Related