|
-
Apr 20th, 2007, 11:04 AM
#1
Thread Starter
Lively Member
[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.
-
Apr 20th, 2007, 11:56 AM
#2
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
 
-
Apr 20th, 2007, 12:14 PM
#3
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
-
Apr 20th, 2007, 12:23 PM
#4
Thread Starter
Lively Member
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!
-
Apr 20th, 2007, 04:13 PM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|