On Dec 26, 2006, at 6:44 AM, Youri wrote:
I'd like to be able to make an Oval control visible/invisible
programatically.
For instance I loop throught all my controls (MyEditfields) and if
one of them (let's say ef_Name) has its property "Compulsory" as
boolean set to "True" but is empty, then I want to access the Oval
ov_Name and set its property "Visible" to "true".
That's easy with' ov_Name.Visible=True' as you have below.
The hard part is that the control must already exist at least once
and have an index so that you can clone it. You cannot create a
control on the fly easily (except using a ContainerControl) but you
can clone any already existing control if it has an index property
(usually "0"). This control can even be off-screen or already
invisible. See page 303 of the User's Guide.
Something in the flavour of :
dim s as string
if ef_Name.iscompulsory = true and ef_Name.text = "" then
s = "Name"
So far; so good.
dim a as New Oval
a.name = s
a.visible = true
You cannot do this directly. You must create the clone from an
existing control by using it's name.
For example, you have an Oval named "MyOval". It has an Index of "0".
At runtime you can say.
Dim a as Oval
a= New MyOval
a.Top= XX //Set its top position
a.Left= XX //Set its left position
a.Visible=True
HTH
Terry
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>