Hey there,
I am kind of in a hurry today so I will just outline here:
inspired by theuserbls' Anchor implementation I came up with a Form.Controls Property aproach.
as described here:
Me.Controls - Collection
I have now uploaded the code to the framework!
Use it like this:
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
|
Public Sub Form_Load()
For i = 0 To Me.Controls.size - 1
Debug.Print i & ". Control: " & Me.Controls.get(i).getClass
Debug.Print i & ". Control: " & Me.Controls.get(i).toString
If IsClass(Me.Controls.get(i), #JComboBox) Then
Dim myCont As VB#ComboBox
myCont = Cast(Me.Controls.get(i), VB#ComboBox)
myCont.enabled = False
End If
Next i
End Sub
|
It works for Dialogs too.
From what I read about java#awt#Component there seems to be no way to retrieve a components name given at designtime after compilation.
Simply because it is only a reference for the programmer and removed at runtime! So you are getting the type of component in the component array!
This is enough to bulk change properties when you have many controls of a kind (e.g. the backcolor of 100 labels)
However, it is possible to uniquely identify a component within its lifecycle by its hashCode:
|
Jabaco Source
|
1
|
Debug.Print i & ". Control: " & Me.Controls.get(i).hashCode
|
Dialogs can now also make use of theuserbls' Anchor property.
Dani