Board index » cppbuilder » Floating form and main form that are simultaneously active

Floating form and main form that are simultaneously active

I want to get the effect of some windows programs where there is one or more
forms that are maintained active and floating on top of the main form and
their mdi childs. (MS Word does this).

When I put a form the "stay on top" atribute I can not find how to maintain
it consistently active even if the user clicks on a tool bar which is in the
main form. This is posible with mdi childs but this is not the desired
effect as they are not staying on top.

Please, if some one can give me some ideas...

Thank you.

 

Re:Floating form and main form that are simultaneously active


On Mon, 13 May 2002 19:34:19 +0200, Cristina <i...@calesdellierca.com>
wrote:

Quote
>When I put a form the "stay on top" atribute I can not find how to maintain
>it consistently active even if the user clicks on a tool bar which is in the
>main form. This is posible with mdi childs but this is not the desired
>effect as they are not staying on top.

You could call SetFocus() in the on-top form's OnDeactivate event to
force focus back to it.

Re:Floating form and main form that are simultaneously active


en artculo 3g00euob34bkb796268tc13ufrbmj98...@4ax.com, Michael Warner en
m...@ozemail.com.au escribi el 13/5/02 20:13:

Quote
> On Mon, 13 May 2002 19:34:19 +0200, Cristina <i...@calesdellierca.com>
> wrote:

>> When I put a form the "stay on top" atribute I can not find how to maintain
>> it consistently active even if the user clicks on a tool bar which is in the
>> main form. This is posible with mdi childs but this is not the desired
>> effect as they are not staying on top.

> You could call SetFocus() in the on-top form's OnDeactivate event to
> force focus back to it.

The effect that I want is that both forms are active at the same time, and
the form staying on top behaves like a mdi child. Supose that I put a TEdit
control on the form staying on top, and also there are some ToolButtons in
the main form with edit actions attached to them. I also have a mdi child
form visible with an edit control.

When I highlight the text in the edit control which is in the form staying
on top, and then click the copy button on the main form, what I get in the
clipboard is a copy of the highlighted text that is in the edit control of
the mdi child form, instead of the one in the form staying on top.

This does not happen if I choose "Copy" from a popup menu attached to the
edit control, because in this case there is no switching of the active form.
And this does not happen either when working only with mdi child forms.

An example of the desired behavior is found in Ms Word. If a toolbar on top
of the screen is made floating by dragging it out of its usual place, you
get a window form staying on top, in which the caption bar is activated (not
grayed) and simultaneously the main and mdichild forms stay activated. Thus,
no changing of active form is shown when clicking on any of the visible
windows.

Other Threads