[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.
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).
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
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!
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.