Subject Re: BrowsingColor runtime change
Author Rick Roen
--- In, "radevojvodic" <rvojvodic@r...>
> Hi all,
> Does anyone know how to change BrowsingColor when IB_Datasource
> focus?
> I have a Master-Detail Form with one updatebar. It controls either
> master or detail depending on focused dataset. I want to change
> browsingcolor to visualy show user which is controled at the
> Rade.
> (Or maybe someone has better solution for the situation)

AFIK the browsing and other default colors (editing,deleting etc.)
are controlled by the default IB_Session that is created at
startup. If you change the browsing color property it would then
change for all connected components.

A possible method to acomplish what you want is to set the IB_Query
or whatever component feeds the edit boxes in question to ignore the
default color scheme - Query.ColorScheme := False;

Then in the IB_Query DataSource use the OnStateChange method to
check if the table is in dssBrowse state. But then you still have to
change the colors of the edit boxes manually. One way to do this is
to put them all on a panel then iterate through the components on
the panel, check if they are TIB_EDIT and change their color.
Something like this (code not tested):

for i := 0 to PanelEdit.ComponentCount - 1 do
if PanelEdit.Component[ i ] is TIB_EDIT then
TIB_Edit( PanelEdit.Component[ i ].Color := <whatever>;