|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
need help changing control properties in vb.net
if i have a form with multiple textboxes on it, can someone please show me how to change a specific property on all of the textboxes at the same time.
|
|
#2
|
|||
|
|||
|
During design time you can press the control button and select all the text boxes before changing the property
During execution mode you could link the text boxs property to one text box. When it changes they all will change. |
|
#3
|
|||
|
|||
|
how do you link all textboxes to one textbox?
i found that i can add each textbox to the controls collection with controls.add(controlname) and then go through that list. |
|
#4
|
||||
|
||||
|
indeed, something like this would be fine: (pseudo-code)
For Each control In Controls If control.Type="textbox" Then control.property="something" Next but of course linking them all is better - I don't know how to do that either. |
|
#5
|
|||
|
|||
|
thanks for the great tips
|
|
#6
|
|||
|
|||
|
that looping structure would work, but im not sure how to compare the current control in the loop with a controlname.
i have tried the following code, but it didnt seem to work. Code:
If x.GetType Is Type.GetType("button", False, True) Then
'do something
End If
does anybody know the correct syntax for doing this? |
|
#7
|
||||
|
||||
|
the syntax in vbscript is:
If LCase(TypeName(x))="button" Then ... |
|
#8
|
|||
|
|||
|
it works perfectly....
thanks for the great help. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > need help changing control properties in vb.net |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|