Board index » delphi » -BUG?-Memo visibility problem - BUG???

-BUG?-Memo visibility problem - BUG???

So here's the deal. Create a form with two memos and 1 button. Set the
visible of the memos to False. Here's the code for the button:

procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.memo2.Lines:=Form1.Memo1.Lines;
Form1.Memo2.visible:=False;
end;

When this is run, the memo2.visible:=False does not take effect!!!
It appears that the assignment statement makes the memo visible, and
setting it to false does nothing.
Any ideas as to what's going on here???
Brad Miller
Timeoil...@aol.com

 

Re:-BUG?-Memo visibility problem - BUG???


Quote
TimeOilMIS wrote:

> So here's the deal. Create a form with two memos and 1 button. Set the
> visible of the memos to False. Here's the code for the button:

> procedure TForm1.Button1Click(Sender: TObject);
> begin
> Form1.memo2.Lines:=Form1.Memo1.Lines;
> Form1.Memo2.visible:=False;
> end;

> When this is run, the memo2.visible:=False does not take effect!!!
> It appears that the assignment statement makes the memo visible, and
> setting it to false does nothing.
> Any ideas as to what's going on here???
> Brad Miller
> Timeoil...@aol.com

Notice - the value of "memo2.visible" is false.  So the code was ignored
it just didn't do anything.

I tried a lockwindowupdate() on the memo's or the form with no success
(then you get a bevel, that is blank) - invalidating (form or memo)makes
no difference either.

Try this as a work around:
  Form1.memo2.text := Form1.Memo1.text;

this assigns the string values rather than the Tstring object itself-
and that solved the problem for me...

1i

Other Threads