If youn mean from code, the answer is not directly as in you can't say 
editfield("editfield1").text="myeditfieldtext"

My solution is something like this,

  dim i As Integer
  Dim controlname As String
  Dim myeditfield As EditField
  for i=1 to 3
    controlname="EditField" + Cstr(i)
    myeditfield=geteditfield(self, controlname) //pass the window that 
contains the control and the name of the control
    if myeditfield<>nil then
      myeditfield.Text=Cstr(i)
    end if
  next i

What this does is fill editfield1 with 1, editfield2 with 2 and 
editfield3 with 3

The function I'm calling is geteditfield and is defined like this
function geteditfield(mywindow as Window, controlname As String) As 
Editfield
  dim myobject As object
  dim myeditfield As EditField
  myeditfield=nil
  myobject=getcontrol(mywindow, controlname)
  if myobject<>nil and myobject IsA EditField then
    myeditfield=EditField(myobject)
  end if
  return myeditfield

The function use the secondary function getcontrol and looks if the 
control exists and is an editfield
If so it returns the control casted as an editfield, if not, it returns 
nil (there is no editfield with this name on this window)
The secondary function getcontrol is defined like this

Function getcontrol(mywindow as Window, controlname As String) As object
  Dim i As Integer
  Dim oReturn As Object
  oReturn=nil
  if mywindow<>nil then
    for i=0 to mywindow.ControlCount-1
      if mywindow.Control(i).Name=controlname then
        oReturn=mywindow.Control(i)
        exit for
      end if
    next i
  end if
  return oReturn
 
This loops all the controls on the window and compares the name of the 
control with the name passed to the function
If a control exists with this name, it return the control as an object 
(to be casted to an editfield in the calling function)
If it doesn't exist, it returns nil

By splitting the function up in two parts I can easily define 
geteditfield, getpushbutton, getlistbox... and always call the same 
getcontrol code

Hope it helps.

Dirk Cleenwerck
Chief Programmer
Useitgroup NV

Giovanni schreef:
> Is there a list of the controls i can see what controls are on the form 
> while on the IDE?
>
> thanks,
>
> giovanni
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to