How to assign a parent form to TColorDialog?

40 views
Skip to first unread message

bou...@gmail.com

unread,
Aug 29, 2007, 12:14:34 PM8/29/07
to
Hi all!

I have a little newbie problem: I have an application that contains a
main form and multiple secondary forms. Those 'secondary forms'
contain TColorDialogs. THe problem is, whenever a user clicks the
button to open the TColorDialog, It brings up the main form and opens
the dialog there, instead of opening it by the secondary form that
called it.

I haven't found any setting that would allow me to specify the
'parent' for the ColorDialog. Could anyone point out to me how to do
it or where to look?

Thanks!

fre...@iafrica.com

unread,
Aug 30, 2007, 12:25:36 PM8/30/07
to

The colordialog has it's own "form" so part of what you're asking
doesn't make sense.
Provide your code if the example below doesn't help.

You should have something like this on each form to do what you're
trying to do.

procedure TForm2.BitBtn1Click(Sender: TObject);
begin
if Colordialog1.Execute then
form2.color := colordiaglog2.color;
end;


poos...@gmail.com

unread,
Jan 16, 2014, 2:48:49 AM1/16/14
to
sorry if too late answer but you can use this:

colorDialog.execute(parent.handle);
Reply all
Reply to author
Forward
0 new messages