Board index » delphi » TComboBox Text shown focused when Font->Color is set

TComboBox Text shown focused when Font->Color is set

Hi,

When I set the color of the font of a TComboBox in the forms
constructor, the TComboBox appears as focused. So after setting the
fonts color of several TComboBoxes almost all appear focused (some
not?). Why is this and how can I avoid this?

Wim

 

Re:TComboBox Text shown focused when Font->Color is set


Quote
In article <3d3d42c7$1_2@dnews>, Wim Bekker wrote:
> When I set the color of the font of a TComboBox in the forms
> constructor, the TComboBox appears as focused. So after setting the
> fonts color of several TComboBoxes almost all appear focused (some
> not?). Why is this and how can I avoid this?

Not unsurprisingly i cannot reproduce this with a simple test case
(D6.02). Try to produce a simple, compilable example that shows the
problem.

Test case was:

type
  TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    ComboBox1: TComboBox; // all properties at defaults
    ComboBox2: TComboBox;
    ComboBox3: TComboBox;
    ComboBox4: TComboBox;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  i: Integer;
begin
  for i:= 0 to componentcount-1 do
    if components[i] is TCombobox then
      Tcombobox( components[i] ).font.color := clBlue;
end;

--
Peter Below (TeamB)  
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be

Re:TComboBox Text shown focused when Font->Color is set


"Peter Below (TeamB)" <100113.1...@compuXXserve.com> schreef in
bericht news:VA.00008f90.0074fc38@antispam.compuserve.com...

Quote
> Not unsurprisingly i cannot reproduce this with a simple test case
> (D6.02). Try to produce a simple, compilable example that shows the
> problem.

A small test program doesnt show this problem. I have to look into my
large program and see whats going on. Btw, Ive turned the comboboxes
into comboboxlist and set itemindex in the constructor (I use
BCB5Pro). This solves my problem.

Wim

Other Threads