Results 1 to 10 of 13

Thread: How can i do this?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Quote Originally Posted by chronozphere View Post
    Just use this:

    Code:
      component := findComponent('somestring');
      if component is TControl then
        TControl(component).Visible := True;
    Hope that helps.
    When i run your code i get the error that findcomponet not exists.
    I give a var that component is a Tcomponent and change the line in
    component.findcomponent('button'+IntToStr(i));
    It compiles run ok but no visible button hmmm why?

    Thank you for the help....

    Update
    I made this and it works

    for i := 0 to howmany do
    begin
    With TBitBtn(FindComponent('BitBtn'+inttostr(i))) do
    Visible := true;
    end;

    But it works only in In the main form if take the code and put it in an empty unit not working
    Any thoughts....
    Last edited by azrael11; 13-02-2011 at 05:37 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •