|
-
Oct 31st, 2007, 08:55 AM
#1
Thread Starter
Junior Member
for next and textboxes
Hi people,
I'm a beginner at this so please bear with me...
I'm trying to write a program and I need to get a for next statement that works with textboxes.
I know from vba that the me.controls statement will do just that, but apparently If i try this in vb.net 2005 this won't work: I get a "property item is read only" error.
I tried this code:
Code:
dim i as integer
for i = 1 to 10
me.controls("textbox" & i ) = i
next i
what am i doing wrong and how cn i make it right
-
Oct 31st, 2007, 08:56 AM
#2
Re: for next and textboxes
what exactly are you trying to do?
-
Oct 31st, 2007, 08:57 AM
#3
Re: for next and textboxes
Welcome to the forums. 
What is it that you are trying to do? Just loop through your textboxs?
-
Oct 31st, 2007, 08:58 AM
#4
Re: for next and textboxes
Me.Controls(index/name) returns a control, youre trying to put an Integer value in its place. I assume you want to set it to the textboxes textvalue:
vb.net Code:
dim i as integer
for i = 1 to 10
me.controls("textbox" & i ).Text = i.ToString()
next i
-
Nov 13th, 2007, 04:57 AM
#5
Thread Starter
Junior Member
Re: for next and textboxes
sorry for my late reply guys, but i haven't had time to continue working on the project.
thanks for replying, i will try Atheist's method, it seems to be doing what i'm trying to accomplish
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
|