Setting multiple properties whilst only referring to the control once

Discussion in 'Basic4ppc Wishlist' started by RandomCoder, May 4, 2007.

  1. RandomCoder

    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
     
  2. enonod

    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
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice