Questions tagged [tcomponent]
14 questions
7
votes
2 answers
Can I use .Create(Nil) instead of .Create(Application)
I have a unit which has a variable of TComponent, I create this component on Initialization of the unit like following :
var
XComp: TComponent;
.
.
.
.
initialization
begin
XCom := TComponent.Create(Application);
end;
after installing the unit…

user1512094
- 611
- 2
- 10
- 23
5
votes
1 answer
Is passing a NULL Owner argument for dynamically created TComponent derived class instances OK?
I work with C++ RAD Studio and Builder 6 quite a bit and often create forms dynamically or create non-visual components dynamically when writing non-visual code. When designing forms, the Owner property of components dropped onto that form is…

mathematician1975
- 21,161
- 6
- 59
- 101
3
votes
1 answer
Can I serialize a Delphi TPersistent as a field of TComponent using the default WriteComponent action?
I'm getting very confused about how to write out properties from a TComponent that has a TPersistent field. For example I have:
TChildObj = class( TPersistent )
PRIVATE
FVisible: boolean;
FColor: TColor;
PUBLIC
PUBLISHED
property…

Brian Frost
- 13,334
- 11
- 80
- 154
2
votes
3 answers
How to access design position on non-visual Delphi components?
When designing a form in the IDE, non-visual components (eg TMainMenus, TDatamodules) can be freely placed and positioned. The position is persisted, so that on reloading the form these components appear in the correct place.
But, TComponent does…

Roddy
- 66,617
- 42
- 165
- 277
1
vote
1 answer
How to invoke a procedure created inside the New Component during the implementation
I have created and implemented a New Component and inside this created component, there is a procedure InitCombo that needs to be invoked in the implementation.
How will I do that?
Here's the procedure InitCombo inside the New Component:
procedure…

RickyBelmont
- 619
- 4
- 11
1
vote
1 answer
I am getting an error "Undeclared Identifier" on my newly created component with TComboBox ancestor
I have created a New Component with TComboBox ancestor using Wizard. Everything went smooth from compiling, building, and installing. Now I tried to use it and I am getting these errors:
Structure
Cannot resolve unit name 'SmartComboBox' at line…

RickyBelmont
- 619
- 4
- 11
1
vote
1 answer
How to Create and Destroy TGrid at Runtime in Firemonkey — Android and iOS App Dev
I have a TGrid created at runtime. The procedure requires that I should destroy TGrid before I can re-create at "add item and refresh" button click. I noticed that if I don't destroy TGrid before re-creating it, heavy overheads cause to freeze my…

RickyBelmont
- 619
- 4
- 11
1
vote
1 answer
Firemonkey: cascade a styled Lookup change for a FMXObject where other objects inherit the stylename
I am not sure if is possible - but it seems like it should be to me. Essentially, I want to trigger all the components to refresh their styles when I change a StyleLookup.
I have a FMXComponent which is a TLabel called BaseStyleLabel. The…

soddoff Baldrick
- 186
- 3
- 7
1
vote
2 answers
Delphi: Save TComponent to Clientdataset blob field
I have a TComponent class derivative like below, trying to save to a clientdataset blob field:
(Copied from internet, due credits)
type
TSaveComponent = class(TComponent)
private
FFileName: string;
public
constructor…

JeffP
- 539
- 1
- 5
- 19
0
votes
0 answers
Confused with error -- E2193 Too few parameters in call to '_fastcall TComponent::GetComponent(int)
I am trying to programmatically remove a selected component from its parent container using the code below (I may be using found incorrectly, but that is not the problem, suggestions are welcome):
void __fastcall…
user16458899
0
votes
0 answers
delphi (RIO 10.3 ) get access to the component icons at runtime ( from the package binary resources ? )
Is it possible to get access to the component icons that are used in the IDE, but at runtime?
I understand the icons are compiled as a binary resource into the package during component development, and the IDE can access them to show, e.g. on the…

DDeberla
- 77
- 5
0
votes
1 answer
Handle copy component from one form to another in Delphi
Writing my own Delphi VCL component inherited from TComponent with a bunch of properties, that must be unique to component's owner form. When I copy component from one form to another (with simple Ctrl+C, Ctrl-V) all properties are copied too.
Any…

zrocker
- 11
- 3
0
votes
1 answer
Delphi: inherited Create gives Access violation
I made an application that opens several other Forms for handling tasks.
All forms work fine, except one.
I am using the same code for all forms. It's like:
FormTypeA := TFormTypeA.Create(Application);
In the Create constructor I added some code to…

cvz
- 139
- 1
- 7
0
votes
1 answer
Delphi XE5 ComponentCount segmentation fault (Search parented tcomponent )
This code collect all TFMXControls in a specified root component. Exam the parent and the component name leading. This code working fine in Win32 32.bit windows target, but not in Nexus (android platform) with page fault in LANC soubrutine first…