Delphi

Show message when Tform2 is created?

不打扰是莪最后的温柔 提交于 2020-01-15 03:51:08
问题 I want to when Tform2 is created then show a message to user. I use this code, but not work well. procedure TForm1.Button1Click(Sender: TObject); var a:TForm2; begin if a=nil then begin a := TForm2.Create(Self); a.Show; end else begin showmessage('TForm2 is created'); end; end; 回答1: That's because you declare a as a local variable. Each time you enter TForm1.Button1Click this variable will be brand new and uninitialized even though there might still be a Form2. That means that the check for

Delphi XE6 TForm.AutoSize

丶灬走出姿态 提交于 2020-01-15 03:42:13
问题 I've code in Delphi XE2 who work perfectly. But in Delphi XE6 it doesn't work. I create a Tform with the property AutoSize to true. I use a TPanel align alTop with a button for create some another panels. procedure TForm2.Button1Click(Sender: TObject); var t :TPanel; begin t := TPanel.Create(self); t.Parent := self; t.Align := alTop; end; The form doesn't auto size. If I want to see all my panels I have to move the form (or try to resize, ....). Have you any idea's ? 回答1: This is indeed a

Altering ITEMINDEX of TComboBox does not trigger it's OnChange event

心不动则不痛 提交于 2020-01-15 03:13:11
问题 When programmatically changing the value of ItemIndex of a TComboBox component in Delphi, one would expect for the corresponding OnChange event to get triggered. Afterall, the visible value of the ComboBox get's changed as a result. Strangely it does not. Same behavior in Delphi6, Delphi 2010 and Delphi XE7. Is there any reason behind this behavior or it's just a pending bug? 回答1: From documentation: Occurs when the user changes the text displayed in the edit region. Write an OnChange event

Why is there no “initialization” keyword in C++, as there is in Delphi?

Deadly 提交于 2020-01-14 18:45:53
问题 Before switching to C++, we found the initialization language element in Delphi extremely useful. It allowed you to have code in each unit which would be called when the program was started, so you could initialize various elements of that unit. This does in our opinion make things easier and helps to keep the code clean. So why is there no initialization and finalization in C++? What are our options for replacements of this language feature in C++? 回答1: The equivalent C++ feature is

XE7 update 1 and iOS 8.1 simulator does not work

烂漫一生 提交于 2020-01-14 18:45:40
问题 With target set to iOS 8.1 Simulator in Delphi XE7, the application crashes. It deploys fine, it also runs, but the firemonkey splash screen remains on and never finishes loading. This happens with a plain new mobile application, only adding one "hello world" TLabel to the form. This began to happen after I upgraded from XE6 to XE7 update 1, and at the same time upgraded XCode 5 to 6.1 (stupid to make do two major upgrades at the same time, because then I don't know which one caused the

Order of TCategoryPanel into TCategoryPanelGroup

我的梦境 提交于 2020-01-14 15:54:54
问题 I got a whole Delphi application with 32 differents forms for data input. I got 1 main TCategoryPanelGroup with 115 diffrents TCategoryPanel on it. There are 6 main TCategoryPanel (main1, to main6) that we found on each forms and we add to this some specific (specific1, 2, 3, and so on) TCategoryPanel to each of them. All forms are already prebuilt in the application, theren't built at runtime. There's the way I do manage those forms (32 forms with an average of 10 panels of information on

Order of TCategoryPanel into TCategoryPanelGroup

吃可爱长大的小学妹 提交于 2020-01-14 15:54:35
问题 I got a whole Delphi application with 32 differents forms for data input. I got 1 main TCategoryPanelGroup with 115 diffrents TCategoryPanel on it. There are 6 main TCategoryPanel (main1, to main6) that we found on each forms and we add to this some specific (specific1, 2, 3, and so on) TCategoryPanel to each of them. All forms are already prebuilt in the application, theren't built at runtime. There's the way I do manage those forms (32 forms with an average of 10 panels of information on

Order of TCategoryPanel into TCategoryPanelGroup

对着背影说爱祢 提交于 2020-01-14 15:54:31
问题 I got a whole Delphi application with 32 differents forms for data input. I got 1 main TCategoryPanelGroup with 115 diffrents TCategoryPanel on it. There are 6 main TCategoryPanel (main1, to main6) that we found on each forms and we add to this some specific (specific1, 2, 3, and so on) TCategoryPanel to each of them. All forms are already prebuilt in the application, theren't built at runtime. There's the way I do manage those forms (32 forms with an average of 10 panels of information on

Order of TCategoryPanel into TCategoryPanelGroup

大城市里の小女人 提交于 2020-01-14 15:54:27
问题 I got a whole Delphi application with 32 differents forms for data input. I got 1 main TCategoryPanelGroup with 115 diffrents TCategoryPanel on it. There are 6 main TCategoryPanel (main1, to main6) that we found on each forms and we add to this some specific (specific1, 2, 3, and so on) TCategoryPanel to each of them. All forms are already prebuilt in the application, theren't built at runtime. There's the way I do manage those forms (32 forms with an average of 10 panels of information on

Order of TCategoryPanel into TCategoryPanelGroup

余生颓废 提交于 2020-01-14 15:53:56
问题 I got a whole Delphi application with 32 differents forms for data input. I got 1 main TCategoryPanelGroup with 115 diffrents TCategoryPanel on it. There are 6 main TCategoryPanel (main1, to main6) that we found on each forms and we add to this some specific (specific1, 2, 3, and so on) TCategoryPanel to each of them. All forms are already prebuilt in the application, theren't built at runtime. There's the way I do manage those forms (32 forms with an average of 10 panels of information on