procedure TForm1.FormCreate(Sender: TObject); begin ComboBox1.Style:=csOwnerDrawFixed; end;procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); begin if odSelected in State then begin ComboBox1.Canvas.Brush.Color:=clHighlight; ComboBox1.Canvas.Font.Color:=clHighlightText; Label1.Caption:=ComboBox1.Items[index]; end else begin ComboBox1.Canvas.Brush.Color:=clWindow; ComboBox1.Canvas.Font.Color:=clWindowText; end; ComboBox1.Canvas.TextRect(rect,rect.left+1,rect.top+1,ComboBox1.Items[index]); end;
begin
ComboBox1.Style:=csOwnerDrawFixed;
end;procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
if odSelected in State then
begin
ComboBox1.Canvas.Brush.Color:=clHighlight;
ComboBox1.Canvas.Font.Color:=clHighlightText;
Label1.Caption:=ComboBox1.Items[index];
end
else
begin
ComboBox1.Canvas.Brush.Color:=clWindow;
ComboBox1.Canvas.Font.Color:=clWindowText;
end;
ComboBox1.Canvas.TextRect(rect,rect.left+1,rect.top+1,ComboBox1.Items[index]);
end;
我想当鼠标移到这些ITEM时以HINT的形式显示它的内容,以便可看到其全部内容
那位同志有较好的方法???????????