Solved

Delphi2010: Layout Problem

Posted on 2010-11-19
8
455 Views
Last Modified: 2012-05-10
hi all,

in one project there is a form A which use a parent form B.

in form A there is a TEdit component, if this component is moved vertically in the IDE, it can be correctly displayed when the application runs. But if this componet is moved  horizontally in the IDE, it turns back to the original position when the application runs.

following are some related information of this TEdit component:

Align: alNone
left: 200

any suggestion?

btw, are there special books or ressource to explain how to design layout in Delphi?

thanks,

wantime
0
Comment
Question by:wantime
8 Comments
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 34171638
post the 2 dfm sources

there is some considerations when redesigning the parent form
when using VFI (Visual Form Inheritance)
0
 
LVL 24

Accepted Solution

by:
jimyX earned 167 total points
ID: 34171680
When Form B calls form A do you set the Left value of the TEdit component in your code (e.g. OnFormA Show or even from Form B) ?
0
 

Author Comment

by:wantime
ID: 34171688
thanks, but the codes is not for public.

0
Industry Leaders: 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!

 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 34171695
then post only the related piece of code

the header of the form
and the piece for the edit

of both forms

too many variables otherwise to ask for
0
 
LVL 37

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 167 total points
ID: 34171789
the biggest problem is with default values
and if they are stored or not in the dfm

this is not so for positioning, but i'm just trying to explain with the property Left

sample:
  default value for property Edit.Left: 50
  if default value > not stored in dfm

start situation
Form A dfm
  > Edit1.Left = 60

Form B dfm (inherited from Form A)

Form B will only store the differences with Form A

situation 2: change form B
Form B
  > Edit1.Left = 80
> save form B > no problem

situation 3: change form A
Form A
  > Edit1.Left = 70
> save form A

the component Edit1 will remain on Edit1.Left = 80 on Form B

there may be other factors  too
 like anchors, margins, oldcreateorder

0
 
LVL 32

Assisted Solution

by:Ephraim Wangoya
Ephraim Wangoya earned 166 total points
ID: 34173463

You probably have code thats specifically setting the the edit's left property or some event that when triggered repositions the Edit

In an inherited form, if you move a control, the controls position is saved in the dfm and thats whats loaded.
0
 
LVL 21

Expert Comment

by:developmentguru
ID: 34180273
You should be able to, easily, create a do nothing example project that you CAN post on this site.  Then the experts would at least have something to work with...
0
 

Author Comment

by:wantime
ID: 34195536
thanks. there are some codes which resetting the edit's left property.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi - replicating a form 8 93
How to debug For loops? 3 63
How to convert memory stream to PDF file 6 186
How to load 2 images in same column in Delphi 2 68
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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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