Results 1 to 5 of 5

Thread: [RESOLVED] [2005] Is there a way to Stack methods on a Control.

  1. #1

    Thread Starter
    Lively Member smilbuta's Avatar
    Join Date
    Apr 2005
    Location
    Orlando
    Posts
    104

    Resolved [RESOLVED] [2005] Is there a way to Stack methods on a Control.

    Hello community...

    Here is my question..

    for example..this is my current code..
    Code:
    cboMiscCombobox.enabled = true
    cboMiscCombobox.visible= ture
    is there a way to stack the methods on one line??

    Code:
    cboMiscComboBox.enabled and visible = true
    I know the code above is incorrect but it reflects what im trying to accomplish if possible.

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,110

    Re: [2005] Is there a way to Stack methods on a Control.

    There isn't a way that is simple enough that it would be useful. If you HAVE to do it, you could make a custom control that inherits the control you want, and add methods that do both things, but I would say that you'd be crazy to do that unless you REALLY needed to get rid of that one extra line (though I assume your actual situation is much more complex than the example you posted).
    My usual boring signature: Nothing

  3. #3
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: [2005] Is there a way to Stack methods on a Control.

    If you don't feel like typing in the control name every time, using "With" key word would help
    Code:
    With cboMiscCombobox
        .Enabled = True
        .Visible = True
        .SelectedIndex = 0
        .Someproperty = " bla bla bla..."
    End With

  4. #4

    Thread Starter
    Lively Member smilbuta's Avatar
    Join Date
    Apr 2005
    Location
    Orlando
    Posts
    104

    Re: [2005] Is there a way to Stack methods on a Control.

    AHA!.. thats what i was looking for. I did not know the syntax on how to do that. Yes my project is a bit more complicated but the lower example will do what i want nicely.

    no more..

    control.yada yada...
    control.yada yada...
    control.yada yada...
    control.yada yada...
    control.yada yada... ARGHH!...

    Thanx fellas!

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,110

    Re: [RESOLVED] [2005] Is there a way to Stack methods on a Control.

    With intellisense, I never have to type more than a character or two anyways, so I have all but forgotten the With bit. Love that feature.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width