<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 13-11-15 11:13 PM, K. P. wrote:<br>
</div>
<blockquote cite="mid:DUB125-W77E814EAC1117EC8D12B51C0FA0@phx.gbl"
type="cite">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div dir="ltr">Look at your Screen object:<br>
<br>
<a moz-do-not-send="true"
href="http://lazarus-ccr.sourceforge.net/docs/lcl/forms/tscreen.html"
target="_blank">http://lazarus-ccr.sourceforge.net/docs/lcl/forms/tscreen.html</a><br>
<br>
Check out FindForm and Forms<br>
<br>
<br>
<br>
<div>> Date: Fri, 15 Nov 2013 22:32:37 -0500<br>
> From: <a class="moz-txt-link-abbreviated" href="mailto:the.tail.kinker@gmail.com">the.tail.kinker@gmail.com</a><br>
> To: <a class="moz-txt-link-abbreviated" href="mailto:lazarus@lists.lazarus.freepascal.org">lazarus@lists.lazarus.freepascal.org</a><br>
> Subject: [Lazarus] Find Form instance with Title<br>
> <br>
> Google has failed me on this one. :( I need to check to
see if a <br>
> dynamically created form (object) with a given title
already exists <br>
> within the application, and if so, to raise it to the
front.<br>
</div>
</div>
</blockquote>
Thanks for the steer! In case anyone cares, here's how I
implemented this:<br>
<br>
procedure TfrmVolume.lstVolumesDblClick (Sender : TObject );<br>
var<br>
NewStoryForm : TfrmStory;<br>
FormCaption : string;<br>
index : integer;<br>
Present : boolean;<br>
begin<br>
FormCaption := 'Volume "' + Volumes.Current.VolumeName + '"'; //
The caption I want to search for/create.<br>
index := 0;<br>
Present := false;<br>
repeat<br>
if (Screen.Forms [index].Caption = FormCaption) then<br>
Present := true<br>
else<br>
index += 1;<br>
until (Present or (index >= Screen.FormCount));<br>
if (Present) then<br>
Screen.Forms [index].BringToFront<br>
else begin<br>
NewStoryForm := TfrmStory.Create (Application);<br>
NewStoryForm.Caption := FormCaption;<br>
NewStoryForm.Show;<br>
end;<br>
end;<br>
<br>
</body>
</html>