We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

How Can I use Form´s Event by Component Code.

rafaelrgl
rafaelrgl asked
on
Medium Priority
215 Views
Last Modified: 2010-04-05
how Can I use:

OnClose
OnShow
OnPaint
.....

I would like to do something on this events using a component.
Comment
Watch Question

if the form owns the component then:

procedure xxxx;
var parent : Tcomponent;
begin
parent := aowner;
while not(parent is TForm) and not(parent = parent.owner) do
  parent := parent.owner;
if parent is tform then with (parent as tform) begin
  close; (closes form)
  show; (shows form)
  if assigned(onshow) then onshow(self); (runs onshow procedure)
end;

Hope this helps u.

Mainiacfreakus

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Mark BradyPrincipal Data Engineer
CERTIFIED EXPERT

Commented:
or try something like this....

procedure xxxxx;
begin
if something then
form1.onclose(sender);  // then make sure there is something in the form1 onclose event.

end;

Elvin
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.