[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-03-24
2
Medium Priority
?
200 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.
0
Comment
Question by:rafaelrgl
2 Comments
 
LVL 2

Accepted Solution

by:
Mainiacfreakus earned 375 total points
ID: 16286259
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
0
 
LVL 20

Expert Comment

by:Mark Brady
ID: 16290847
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
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month18 days, 18 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question