[Gambas-user] How top clearing a readonly textbox

T Lee Davidson t.lee.davidson at gmail.com
Sat Nov 26 06:04:15 CET 2022


On 11/25/22 22:16, BB wrote:
> Yeah, I over simplified my problem. I'm trying to clear a form by going through all the controls and trying to "clear" them.

I didn't actually look at your demo, so I may be spinning my wheels here. However, here is a solution similar to Jussi's but 
accomplished in a different way.

[code]
   Dim bHasReadOnly, bReadOnly As Boolean

   For Each ctl As Object In Me.Controls
     Try bReadOnly = Object.GetProperty(ctl, "ReadOnly")
     bHasReadOnly = IIf( Error , False, True)
     If bHasReadOnly Then
       If bReadOnly Then Continue
       ctl.clear
     Endif
   Next
[/code]


-- 
Lee



More information about the User mailing list