Board index » delphi » help please (count bytes)

help please (count bytes)

Piece of cake!
  Edit1.Text := ComboBox1.Text;

B3avis <b3avis_...@hotmail.com> skrev i en
nyhedsmeddelelse:7q6o15$t5...@news1.skynet.be...

Quote
> Hey there,
> imagine: I have an combobox and I want to - when I click a button -
display
> the number of bytes in the box in an editbox

> how can I hadle this the easiest way ?

 

Re:help please (count bytes)


If you want to display the length of just selected item when it is
clicked, you can use something like the following.

  procedure TForm1.ComboBox1Change(Sender: TObject);
  begin
    Edit1.Text :=
IntToStr(Length(ComboBox1.Items[ComboBox1.ItemIndex]));
  end;

If you want to display the length of a selected item, or anything that
is typed into the text box at the top of the ComboBox, you can use
something like this.

  procedure TForm1.ComboBox1Change(Sender: TObject);
  begin
    Edit1.Text := IntToStr(Length(ComboBox1.Text));
  end;

HTH,

dick

On Sat, 28 Aug 1999 12:48:49 +0200, "Finn Tolderlund"

Quote
<XnojunkmailXf...@teliamail.dkXnojunkmailX> wrote:
>Piece of cake!
>  Edit1.Text := ComboBox1.Text;

>B3avis <b3avis_...@hotmail.com> skrev i en
>nyhedsmeddelelse:7q6o15$t5...@news1.skynet.be...
>> Hey there,
>> imagine: I have an combobox and I want to - when I click a button -
>display
>> the number of bytes in the box in an editbox

>> how can I hadle this the easiest way ?

Other Threads