Subject Re: [IBO] IB_LookupCombo.TextWidth
Author Geoff Worboys
> But this gives me the wrong result. Does anyone know
> how to get the exact width ?

Generally you can just use the Form's Canvas property for such
calculations - depending on whether you have changed the font in your
controls. If you have changed the font I am wondering whether you
should be just using a TCanvas (not a TControlCanvas - I am not
certain but there are some device context issues when using
TControlCanvas). Create a TCanvas, assign the font from the control
and then do the width calculation.

Have you allowed for the width of the button on the lookup?


> My second problem is to find an event when to adjust the width.
> I tried ComboBox.OnCloseUp but when this event occurs then
> sometimes
>
> FQryLkNode.FieldByName('TNR_ID_NODEREL').IsNull = true;
>
> I guess that during this event the Dataset is scrolling
> and therefor has no current record. "AfterScroll" fires
> too often. Is there a better event for this ?

Not sure about this, have you tried the TIB_DataSource.OnDataChange
event?


Geoff Worboys
Telesis Computing