How to find the control having Width < 10

Hi,

I seems to be very weird question though.
Is there any way to find the control having Width < 10?

you can iterate over all controls on a window, example here: http://documentation.xojo.com/index.php/Window.Control

It seems that there is no width property in control(i). I got error saying 'Type Control has no member named “width” ’
How can I use ‘width’?

[code]
Dim c As Control
For i As Integer = 0 To Self.ControlCount-1

If MainWindow.RepScreen.Control(i).width < 10 Then
  
  MsgBox " Control name : " + MainWindow.RepScreen.Control(i).Name
End If

Next[/code]

I can’t look into this right now, but you will probably need to check if the control is a RectControl

Control doesn’t have a Width property, but RectControl does. You need to check if the control is a RectControl and then cast it to get to the Width property:

If MainWindow.RepScreen.Control(i) IsA RectControl Then If RectControl(MainWindow.RepScreen.Control(i)).Width < 10 Then

It works well !! Thank you.

  Dim c As Control
  For i As Integer = 0 To Self.ControlCount-1
    
    If MainWindow.RepScreen.Control(i) IsA RectControl Then
      'If RectControl(MainWindow.RepScreen.Control(i)).Width < 50 Then
      If RectControl(MainWindow.RepScreen.Control(i)).Height < 10 Then
        MsgBox " Control name : " + RectControl(MainWindow.RepScreen.Control(i)).name
      End If
    End IF
  Next