Board index » delphi » maintaining equal width for two controls

maintaining equal width for two controls

Hi,

   On a panel that is resized by a splitter I have two TMemo components. Now
as the panel grows / shrinks. I want to maintain equal width for both memos.
That is to say that if panel grew by X. Then memo1/memo2 each should grow by
X/2.

  I can achieve this by using the onMove event of the splitter and doing
some arithmetic to find the new sizes of the memos. But is there a simple,
neat way of getting something like this to work

thx

D

 

Re:maintaining equal width for two controls


On 25 Feb 2003, "dvorak" <dvora...@ifrance.com> wrote:

Quote
> On a panel that is resized by a splitter I have two TMemo components.
> Now as the panel grows / shrinks. I want to maintain equal width for
> both memos. That is to say that if panel grew by X. Then memo1/memo2
> each should grow by X/2.

The memos are side by side?  I can't think of an easy way to do that
without performing the calculations yourself.  However, it's not difficult
and manually calculating the sizes wouldn't be any less efficient than if
there were some "automatic" method available.

--
-Mike

Re:maintaining equal width for two controls


"Mike Williams (TeamB)" <mi...@remove.aps-soft.com> wrote in message
news:Xns932DC27514167mikewteamb@207.105.83.65...

Quote
> On 25 Feb 2003, "dvorak" <dvora...@ifrance.com> wrote:

> > On a panel that is resized by a splitter I have two TMemo components.
> > Now as the panel grows / shrinks. I want to maintain equal width for
> > both memos. That is to say that if panel grew by X. Then memo1/memo2
> > each should grow by X/2.

> The memos are side by side?  I can't think of an easy way to do that
> without performing the calculations yourself.  However, it's not difficult
> and manually calculating the sizes wouldn't be any less efficient than if
> there were some "automatic" method available.

Thx Mike,

   Yes, they are side by side. Just as i had thought, I could not find any
simple way to doing it. It would have been nice to have a design time
possibility. But well, i'll just go ahead and do the calculations.

D

Other Threads