David C
asked on
CType(Page.FindControl Windows equivalent
Hi, is there an equivalent in VB.NET Windows Applications for
CType(Page.FindControl("La bel" & i), Label).Text = Label14.Text
variable i will be incrementing
Thanks
CType(Page.FindControl("La
variable i will be incrementing
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Assuming that you know that there is a Label for each value of i, and that Page is a form:
Page.Controls("Label" & i.ToString).Text = Label14.Text
If the Label is in the same form as the code then:
Me.Controls("Label" & i.ToString).Text = Label14.Text
Page.Controls("Label" & i.ToString).Text = Label14.Text
If the Label is in the same form as the code then:
Me.Controls("Label" & i.ToString).Text = Label14.Text
Searches for controls by their Name property and builds an array of all the controls that match.
Open in new window
Parameters
key
Type: System.String
The key to locate in the Control.ControlCollection.
searchAllChildren
Type: System.Boolean
true to search all child controls; otherwise, false.
Return Value
Type: System.Windows.Forms.Contr
An array of type Control containing the matching controls.