// JP opened flex table

Click to See Complete Forum and Search --> : C++ Builder: No focus for windows with BorderStyle bsToolWindow


AlionSolutions
September 22nd, 2007, 11:48 AM
Hi,
I am having a weird problem with windows in a MDI-Application with BorderStyle bsToolWindow.

I want those windows to stay inside the mainwindow of the MDI-Application. So I set the mainwindow as the Parent of the toolwindow.

The constructor of the toolwindow looks like this (owner is the mainwindow):

__fastcall toolwindow::toolwindow(TWinControl* owner)
: TForm(owner,0)
{
BorderStyle = bsToolWindow;
Parent = owner;
}


Now the problem: When I do this, and the toolwindow contains TEdits, I am unable to enter something in the TEdits, because I cannot get the focus on them by left mouse clicking. Strange thing is, if I right click into the TEdits I can focus them and enter text.

If I don't set the parent of the toolwindow, it is no longer limited to the main application window, but I can enter text into the edits.

If I do not set the BorderStyle to bsToolWindow, I also can also enter text into the edits.

The problem just occurs, when I use the combination

toolwindow->Parent = mainwindow
toolwindow->BorderStyle = bsToolWindow

I have this problem on Windows 2000 and Windows XP.

Thanks in advance for any help.

Sonny

//JP added flex table