0
votes

In want to use LiveBindings in Delphi XE5. I am new to this.

I have a VCL TForm with a TEdit.

I have a component in a seperate unit:

TMyComponent=class(TComponent)
private
  FMyProperty: Integer;
public
  property MyProperty: Integer read FMyProperty write FMyProperty;
end;

Now I want to bind MyProperty to the TEdit.

I tried this with right clicking on the TEdit and select "Bind visually" as well as with the LiveBindings wizard. The problem is that the MyComponent is not listed in the components list there.

The unit which contains MyComponent is in the uses clause of the form.

What am I doing wrong?

Thanks!

1
Did you build MyComponent in a component package and register that package with the IDE?Mason Wheeler
@MasonWheeler No. MyComponent is not in a package. It is non-visual and created at runtime.user3384674
That's probably why the IDE doesn't know about it.Mason Wheeler
Thank you! Then I have to create the binding programmatically? Or what is the best way to do it? If programmatically: do you know a tutorial how to do it?user3384674

1 Answers

1
votes

The IDE only knows about component classes that have been registered with it. To make this work at design-time, you need to build a package that registers the component class. Otherwise, you'll need to create the bindings programmatically. I'm not particularly familiar with the LiveBindings system, but there are several questions in the tag that show how it's done.