Setting multiple properties whilst only referring to the control once

RandomCoder

Well-Known Member
Licensed User
I don't know the correct syntax but instead of -

TextBox1.FontSize=10
TextBox1.FontColor=cWhite
TextBox1.Color=cBlue
TextBox1.Text="Hello"

I'd like to see this -

TextBox1
.FontSize=10
.FontColor=cWhite
.Color=cBlue
.Text="Hello"​

It would save me a considerable amount of time and I think it also leads to a cleaner looking code.

Regards,
RandomCoder
 

enonod

Well-Known Member
Licensed User
I have only just landed, and seen this.
Yes a great idea, seconded. It is normally called 'With'

With Table
Colwidth("fred")=0
etc
etc
End with
 
Top