<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — Centre Child Forms relative to Main Form]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=8673</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=8673&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Centre Child Forms relative to Main Form.]]></description>
		<lastBuildDate>Sun, 10 Sep 2023 23:16:09 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Centre Child Forms relative to Main Form]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=48773#p48773</link>
			<description><![CDATA[<p>Спасибо Vladimir,<br />Это очень помогло. Я пытался переместить &quot;child forms&quot; после того, как открыл их, а не раньше.<br />А использование &quot;poMainFormCentre&quot; вместо попыток вычисления позиции делает скрипт намного компактнее.<br />Теперь все работает как надо.<br />С уважением,<br />Derek.<br />.<br />That has helped a lot.&nbsp; I was trying to move the &quot;child forms&quot; after I had opened them rather than before.<br />And using &#039;poMainFormCentre&#039; instead of trying to calculate the position makes the script much more compact.<br />Everything works as it should now.</p>]]></description>
			<author><![CDATA[null@example.com (derek)]]></author>
			<pubDate>Sun, 10 Sep 2023 23:16:09 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=48773#p48773</guid>
		</item>
		<item>
			<title><![CDATA[Re: Centre Child Forms relative to Main Form]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=48772#p48772</link>
			<description><![CDATA[<p>Дело в том, что позиция формы устанавливается только 1 раз при ее открытии.<br />Вам нужно устанавливать ее позицию постоянно.<br />&nbsp; <br />The fact is that the position of the form is set only once when it is opened.<br />You need to establish its position constantly.</p><div class="codebox"><pre><code>procedure Form1_buttonabout_OnClick (Sender: TObject; var Cancel: boolean);
begin
  FormAbout.Position := poMainFormCenter;
end;

procedure Form1_buttondelete_OnClick (Sender: TObject; var Cancel: boolean);
begin
  Form3.Position := poMainFormCenter;
end;

procedure Form1_buttonadd_OnClick (Sender: TObject; var Cancel: boolean);
begin
  Form2.Position := poMainFormCenter;
end;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (pavlenko.vladimir.v)]]></author>
			<pubDate>Sun, 10 Sep 2023 21:27:08 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=48772#p48772</guid>
		</item>
		<item>
			<title><![CDATA[Centre Child Forms relative to Main Form]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=48771#p48771</link>
			<description><![CDATA[<p>Hello All,<br />Some help if anyone has any ideas please.<br />THE PROBLEM<br />I have an application with a main form (Form1) and a number of child forms (see screen1 in the attachment).&nbsp; <br />However, if I move Form1 anywhere on the monitor, then the child form is no longer centred on Form1 (see screen2 in the attachment).<br />WHAT I DO AT THE MOMENT<br />The position of the child forms is forced to be centred on Form1 with a script (see screen3 in the attachment).&nbsp; <br />But within the procedure, the code to re-centre each child form is repeated - the more child forms, the more the code is repeated.&nbsp; This is what I want to avoid.<br />WHAT I&#039;M TRYING TO DO (without success!)<br />Create a procedure (similar to screen4 in the attachment (which obviously is incorrect at the moment)) that <br />1.&nbsp; uses a variable (&#039;vform&#039;) to identify the name of any child form that has just been opened and <br />2.&nbsp; uses that variable as part of the formula to re-centre the child form.<br />I&#039;m using Windows 10 / MVD 6.5.<br />Any ideas and help would be appreciated.<br />Regards,<br />Derek.</p>]]></description>
			<author><![CDATA[null@example.com (derek)]]></author>
			<pubDate>Sun, 10 Sep 2023 19:47:37 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=48771#p48771</guid>
		</item>
	</channel>
</rss>
