Peekay Active Member Licensed User Longtime User Jul 8, 2020 #1 I have a label named lblMessage, which is the only label by that name in my app. I did not know that labels can be made into an array or collection with different indexes (indices), and the properties of the label view does not show index as a property. The code line with the error is: Code: lblMessage.Text = "Enter the registration code" The error I Get is: Index was out of range. Must be non negative and less than the size of the collection. Parameter name: Index Click to expand... PK
I have a label named lblMessage, which is the only label by that name in my app. I did not know that labels can be made into an array or collection with different indexes (indices), and the properties of the label view does not show index as a property. The code line with the error is: Code: lblMessage.Text = "Enter the registration code" The error I Get is: Index was out of range. Must be non negative and less than the size of the collection. Parameter name: Index Click to expand... PK
toby Well-Known Member Licensed User Longtime User Jul 8, 2020 #2 It would be better if a sample app is provided Upvote 0
JohnC Expert Licensed User Longtime User Jul 8, 2020 #3 Try deleting that label and re-adding it. Upvote 0
DonManfred Expert Licensed User Longtime User Jul 8, 2020 #4 Do you have any empty module in your project? If so, remove it. Upvote 0
Peekay Active Member Licensed User Longtime User Jul 8, 2020 #5 Thanks guys, When I completed the 'if .. end if' construct , this error disappeared. I do not why it gave it. It has nothing to do with the construct. I take note of the two good tips by JohnC and DonManfred. PK Upvote 0
Thanks guys, When I completed the 'if .. end if' construct , this error disappeared. I do not why it gave it. It has nothing to do with the construct. I take note of the two good tips by JohnC and DonManfred. PK