Board index » delphi » MDI app with 2 types of child
j...@bton.ac.uk (John English)
![]() Delphi Developer |
Sun, 14 Mar 1999 03:00:00 GMT
|
j...@bton.ac.uk (John English)
![]() Delphi Developer |
Sun, 14 Mar 1999 03:00:00 GMT
MDI app with 2 types of childI'm writing a MDI app with two different MDI child types. if TypeOf(MDIChildren[I]) = TypeOf(TChild1) then... but the compiler moaned. Is there an easy way to achieve Thanks in advance. --------------------------------------------------------------- |
Lord of Darknes
![]() Delphi Developer |
Sun, 14 Mar 1999 03:00:00 GMT
Re:MDI app with 2 types of childTry something like this function TWavesApp.IsArrayWindow(TF:TForm) : boolean; procedure TWavesApp.findwinwithid(var Msg:TMessage); This does a check for window type, and my (common) base class stores hope this helps John B |
Song Weng S
![]() Delphi Developer |
Mon, 15 Mar 1999 03:00:00 GMT
Re:MDI app with 2 types of childOn 25 Sep 1996 09:38:17 GMT, j...@bton.ac.uk (John English) wrote: ~I'm writing a MDI app with two different MDI child types. This looks like something which I had done before. In order to for I := 0 to MDIChildCount-1 do begin The above sample code is based on the assumption that it has two HTH Finest Regards, _ __ _____ _____ Email : son...@pacific.net.sg |
James A. O'Bri
![]() Delphi Developer |
Mon, 15 Mar 1999 03:00:00 GMT
Re:MDI app with 2 types of childQuoteIn article <52aui9$...@saturn.brighton.ac.uk>, j...@bton.ac.uk (John English) wrote: begin TChild1(MDIChildren[i]).callATChild1Method; end or try Hope this helps...Jim. _______________________________________________________________________ |
Stefan Hoffmeist
![]() Delphi Developer |
Mon, 15 Mar 1999 03:00:00 GMT
Re:MDI app with 2 types of childOn 25 Sep 1996 09:38:17 GMT, j...@bton.ac.uk (John English) wrote: Quote>I'm writing a MDI app with two different MDI child types. -- Stefan Hoffmeister Stefan.Hoffmeis...@Uni-Passau.de University of Passau, Bavaria, Germany |
na..
![]() Delphi Developer |
Mon, 15 Mar 1999 03:00:00 GMT
Re:MDI app with 2 types of childson...@pacific.net.sg (Song Weng Sam) wrote: Quote> for I := 0 to MDIChildCount-1 do begin because you have already established what type the object is. A type cast would be more appropriate and more efficient: for I := 0 to MDIChildCount-1 do begin |
Song Weng S
![]() Delphi Developer |
Tue, 16 Mar 1999 03:00:00 GMT
Re:MDI app with 2 types of childQuoteOn Thu, 26 Sep 1996 21:28:36 GMT, na...@vivid.net wrote: ~> if ActiveMDIChild is TfrmChartChild then ~> (ActiveMDIChild as TfrmChartChild).Execute; ~> if ActiveMDIChild is TfrmBMPViewer then ~> (ActiveMDIChild as TfrmBMPViewer).Execute; ~> end; ~ ~Not to be too picky or anything, but the use of AS is redundant, ~because you have already established what type the object is. A type ~cast would be more appropriate and more efficient: ~ ~ for I := 0 to MDIChildCount-1 do begin ~ if ActiveMDIChild is TfrmChartChild then ~ TfrmChartChild (ActiveMDIChild).Execute; ~ if ActiveMDIChild is TfrmBMPViewer then ~ TfrmBMPViewer(ActiveMDIChild).Execute; ~ end; Hi, Thanks for the tips. I will try it next time around. Finest Regards, _ __ _____ _____ Email : son...@pacific.net.sg |
2. MDI Child over another MDI Child
3. Tracking open child forms in MDI apps
4. MDI Apps Minimising Child Windows
5. Switching MDI children with Delphi app flashes
6. Switching MDI children with Delphi app flashes
7. Problem focussing TwwDBGrid in Child Form Of MDI App
8. MDI App. - Problem closing children