tform

Delphi - is it possible to disable Delphi's lazy loading of forms?

假如想象 提交于 2021-01-28 12:16:36
问题 I've heard that the Delphi application uses "lazy loading", deferring the loading of form components until they are actually referenced. It was mentioned in another post - "That's why we changed TPageControl to be lazy-load - the Delphi IDE's options dialog was taking too long to load!" I assume this applies to applications created with Delphi as well, but I can't find any mention of lazy loading in the VCL sources, suggesting maybe it's called something else if it does exist. In cases where

Will an interface-implementing form free itself when there are no more references to it?

怎甘沉沦 提交于 2020-01-11 05:24:04
问题 If I implement an interface on a form such as TMyForm = class(TForm, IMyInterface) , will the object free itself when there are no more interface references to it? It seems not to, although I couldn't work out how TForm is reference counted (if at all). I'm concerned about the form getting freed when an interface reference goes out of scope, but this does not seem to happen. I guess there are two parts to the question, firstly whether a form might get unexpectedly freed (the real question),

How can I display a Delphi form in a panel?

大城市里の小女人 提交于 2019-12-21 23:17:52
问题 I've tried to follow the example of http://docwiki.embarcadero.com/CodeExamples/XE7/en/FMXEmbeddedForm_(Delphi) but I hit my first problem with the children of TCustomForm, which are apparently read only, so I commented that out and put in ArgForm.Parent:= ArgParent; instead, but I still just get an empty screen and can't see the buttons that are in my second form. The code for my main form is: unit Unit1; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System

Make 2 forms able to overlap each other?

给你一囗甜甜゛ 提交于 2019-12-18 08:29:14
问题 I would like to have a seperate form that shows "along" with my main form, so it does not overlap the main form. Here's an example: Notice how the main program, overlaps the log? I can't figure out how to do that in Delphi. Thanks! 回答1: The answers to this question lie in the very useful Window Features MSDN topic. The pertinent information is: An overlapped or pop-up window can be owned by another overlapped or pop-up window. Being owned places several constraints on a window. An owned

Delphi: frame properties do not update when I expect them to (they get stuck)

和自甴很熟 提交于 2019-12-12 08:15:08
问题 I have a frame on a form. When I change the frame (add/delete buttons, labels) no changes appear on the form or controls have other positions in the form that in the frame. If to delete the frame from the form and add it again -> Ok. Why? As I remember there were no problems in Delphi 2010 (now-Delphi XE). Thanks. 回答1: So you had created a frame, and then dropped an instance of it on another form, and the problem is that later changes made to the original frame are not immediately shown until

Main Form not displaying when showing modal form in main form's OnShow?

廉价感情. 提交于 2019-12-11 13:12:48
问题 I have created one application in which Main Form Calls Sub Form on FormShow event of Main Form. Sub Form is displayed and gives two options to choose. If First option on sub form is selected then then a Message is displayed and after that Main form will be displayed. Now when application runs on first time then after option selected on subform Meassage will be displayed. But i want to display message with Main Form as Background. So any solution to this. below is the FormShow code. Procedure

Delphi - Capturing the Window/Form which has current focus

元气小坏坏 提交于 2019-12-11 03:15:41
问题 I have an MDI application with numerous MDI Children (and also non MDI forms) and would like to track which form is currently activate and has the focus at all times. When a user switches from one form to another within the application I would like to trap the window activation message and in the background set a global variable to a property of the form which is active (this property is inherited from a base class). I originally put code in the OnActivate event handler for the base class

Delphi Form with custom constructor as the mainform?

旧时模样 提交于 2019-12-11 00:42:37
问题 I want to have a MainForm that is derived from a BaseForm that has a custom constructor. Since this is the Mainform, it is created by a call to Application.CreateForm(TMyMainForm, MyMainForm) in the *.dpr file. However, my custom constructor is not called during form creation. Obviously, it works fine, if I call MyMainForm := TMyMainForm.Create(AOwner) . Can I not use a form with custom constructor as the main form ? TBaseForm = class(TForm) constructor Create(AOwner:TComponent; AName:string)

Is it possible to dynamically create form without having *.dfm and *.pas files?

穿精又带淫゛_ 提交于 2019-12-10 13:39:18
问题 is it possible to create and show TForm without having source files for it ? I want to create my forms at runtime and having the empty *.dfm and *.pas files seems to me useless. Thank you 回答1: Do you mean like this? procedure TForm1.Button1Click(Sender: TObject); var Form: TForm; Lbl: TLabel; Btn: TButton; begin Form := TForm.Create(nil); try Form.BorderStyle := bsDialog; Form.Caption := 'My Dynamic Form!'; Form.Position := poScreenCenter; Form.ClientWidth := 400; Form.ClientHeight := 200;

Delphi 7 - Handling MouseWheel events for Embedded Frames in Forms?

别等时光非礼了梦想. 提交于 2019-12-04 22:19:59
问题 Hi I have a form with several frames inside. For some of the frames, i wish to scroll the contents (or at least handle the mousewheel event). I have tried the following: Simply assigning a OnMouseWheel event handler for each frame Overriding the MouseWheel event for the parent form: procedure TFmReview.MouseWheelHandler(var Message: TMessage); var Control: TControl; begin Control := ControlAtPos(ScreenToClient(SmallPointToPoint(TWMMouseWheel(Message).Pos)), False, True); if Assigned(Control)