Thanks for the reply.
I'm not trying to set the text for the labels. That was done in the property settings for the labels themselves when I created my form. The text is set as "Seat 1", "Seat 2", etc...
I have a million labels on this form.
lblLabel1
lblLabel2
lblLabel3
lblLabel4
etc...
I created an array so that I could use loops to manage...
User Profile
Collapse
-
How do you convert a string into an object
So, I'm creating an array of labels. I have labels set up as:
labal1
label2
label3
etc...
I've declared the array as such:
Now, instead of assigning the labels one by one to the array (labelArray(0) = label1, labelArray(1) = label2, etc...), I was hoping to use a loop (there will be more than 5 labels). I have something like this, which obviously doesn't...Code:Dim labelArray(5) As Label
-
Okay, got it.
So, was getting some out of bounds for the record when looking at other records (have a form set up where you can view a record at a time).
So, under the text changed event, I used:
Then under button click events (when moving through records), added:Code:If IsNumeric(txtPhoneNumber.Text) Then phoneNumber = CDbl(txtPhoneNumber.Text.Trim) End If
...Leave a comment:
-
Formatting databound textbox as a phone number in VB.NET
I have a databound textbox that I would like formatted as a phone number ((###) ###-####), instead of being displayed as 10 numbers.
I'm using this on a databound label, which works fine. The same doesn't work on a textbox, though.
phoneNumber = CDbl(lblPhoneNu mber.Text)
lblPhoneNumber. Text = phoneNumber.ToS tring("(###) ###-####")
Anyone know of something that will work...
No activity results to display
Show More
Leave a comment: