Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
11
Erster Beitrag:
vor 3 Jahren, 2 Monaten
Letzter Beitrag:
vor 3 Jahren, 2 Monaten
Beteiligte Autoren:
Curtis, Alexandre Leclerc, Fabrice Harari

[WD19] How to add Content to a Created Control [SOLVED]

Startbeitrag von Curtis am 19.03.2015 22:09

How would I load in memory content from a file to a created control(c)?

c is Control
c

Antworten:

Re: [WD19] How to add Content to a Created Control

Hello Curtis,

you are looking for the indirection mechanism using the {ControlName,indcontrol}=value syntax
Look it up in the help, it's extremely powerful

Best regards

von Fabrice Harari - am 19.03.2015 22:35

Re: [WD19] How to add Content to a Created Control

Hi Curtis,

Adding to what Fabrice said, using the new "Control" variable makes you able to directly access the field properties. Simply look at the help.


c is Control
c


von Alexandre Leclerc - am 20.03.2015 12:42

Re: [WD19] How to add Content to a Created Control

Awesome. Thanks. Now if I can just get ..Process and ChangeStyle() to work I'll be in business.

How does ..Process work? I can't get this to work, nor do I see how you would pass in parameters as it throws an error when adding the parenthesis.

c..Process[trtInit] = GetEmployees // GetEmployees() is local procedure of window

von Curtis - am 20.03.2015 14:19

Re: [WD19] How to add Content to a Created Control

Hi Curtis,

GetEmployees must not receive parameters. Use globals if you want to do that. But I suspect your code is not organized efficiently if you need to use the trInit process as so (or you are doing stuff you should not - trInit is called upon creation of the control so it would be useless afterward).

Also, do not forget that if you use the same query for many COMBO controls you must create as many different queries because one query will "feed them all" so to say. You probably do not want that.

For ChangeStyle, in version 20 you will be able to use the ..Style property. Otherwise, you must create a template to your project as described in this post: http://27130.foren.mysnip.de/read.php?27131,514495,514505#msg-514505

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 20.03.2015 14:34

Re: [WD19] How to add Content to a Created Control

Hi Curtis

and to add to Alexandre's answer...

You are trying to set the INIT process of a field...
In the regular INIT process of a field, there is no parameter allowed (nor would it make any sense, as it is a fixed process done once)
Therefore, there is no reason or mechanism to pass parameters to a dynamic init process

Best regards

von Fabrice Harari - am 20.03.2015 14:57

Re: [WD19] How to add Content to a Created Control

Why can't I get this code to work on my End of Init process for a window? The control displays, but I can not click it/use it. However, if I place the code in a button on the form and click the button I can think access the created control.

c is Control
c

von Curtis - am 23.03.2015 20:07

Re: [WD19] How to add Content to a Created Control

Hi Curtis,

Good question. What is the ..State of the control? Try making it ..State = Active. Can it get the focus when you click it? As far as I know I'.m creating buttons in the same process and they are clickable.

A simply bypass would be to create your controls in a procedure and make this procedure a timer which is launch right after init. But this is not a nice solution.

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 23.03.2015 20:17

Re: [WD19] How to add Content to a Created Control

I've tried ..State = Active. I'd really like to find a way without the timer.

von Curtis - am 23.03.2015 20:21

Re: [WD19] How to add Content to a Created Control

For the time being I'm going to switch to one static control, and then clone (ControlClone()) it.

von Curtis - am 23.03.2015 21:16

Re: [WD19] How to add Content to a Created Control

Hi Curtis,

By the way, drop an email to the Free Technical Support to report your issue with a small program example (if it is not already done).

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 24.03.2015 12:09
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.