Connecting Tech Pros Worldwide Forums | Help | Site Map

list elements in form

glbdev@gmail.com
Guest
 
Posts: n/a
#1: May 7 '07
Hi,

Can anyone tell me how to get the ID's and text from all the labels,
textboxes, checkboxes, buttons, etc in a form? This needs to be in
VB, not C#.

Thanks!
Steve


Michael Nemtsev
Guest
 
Posts: n/a
#2: May 7 '07

re: list elements in form


Hello glbdev@gmail.com,

All elemens on the page are stored hierarchy into Page object.
So, just iterate throght them, taking ID and Name properties


---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Quote:
Hi,
>
Can anyone tell me how to get the ID's and text from all the labels,
textboxes, checkboxes, buttons, etc in a form? This needs to be in
VB, not C#.
>
Thanks!
Steve

glbdev@gmail.com
Guest
 
Posts: n/a
#3: May 7 '07

re: list elements in form


On May 7, 4:31 pm, Michael Nemtsev <nemt...@msn.comwrote:
Quote:
Hello glb...@gmail.com,
>
All elemens on the page are stored hierarchy into Page object.
So, just iterate throght them, taking ID and Name properties
>
---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog:http://spaces.live.com/laflour
Team blog:http://devkids.blogspot.com/
>
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
>
>
>
Quote:
Hi,
>
Quote:
Can anyone tell me how to get the ID's and text from all the labels,
textboxes, checkboxes, buttons, etc in a form? This needs to be in
VB, not C#.
>
Quote:
Thanks!
Steve- Hide quoted text -
>
- Show quoted text -
================================================== ================================================== =====
================================================== ================================================== =====

I guess I should have said that I am new to VB.Net ... how do I do
that? Do you have a code example?

Thanks,
Steve

glbdev@gmail.com
Guest
 
Posts: n/a
#4: May 7 '07

re: list elements in form


On May 7, 4:31 pm, Michael Nemtsev <nemt...@msn.comwrote:
Quote:
Hello glb...@gmail.com,
>
All elemens on the page are stored hierarchy into Page object.
So, just iterate throght them, taking ID and Name properties
>
---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog:http://spaces.live.com/laflour
Team blog:http://devkids.blogspot.com/
>
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
>
>
>
Quote:
Hi,
>
Quote:
Can anyone tell me how to get the ID's and text from all the labels,
textboxes, checkboxes, buttons, etc in a form? This needs to be in
VB, not C#.
>
Quote:
Thanks!
Steve- Hide quoted text -
>
- Show quoted text -

I guess I should have mentioned that I am new to VB.Net. How do I
loop through the for and do this? Do you know of some example code?

Thanks,
Steve

David Longnecker
Guest
 
Posts: n/a
#5: May 7 '07

re: list elements in form


http://steveorr.net/faq/ControlTreeRecursion.aspx

This should be of some help; it gives some source code (for both C# and VB)
and explains what it's doing.

You can modify the code to capture the values into an array (rather than
chance the .BackColor of the textboxes).

HTH

-dl

---
David R. Longnecker
Web Developer
http://blog.tiredstudent.com
Quote:
On May 7, 4:31 pm, Michael Nemtsev <nemt...@msn.comwrote:
>
Quote:
>Hello glb...@gmail.com,
>>
>All elemens on the page are stored hierarchy into Page object. So,
>just iterate throght them, taking ID and Name properties
>>
>---
>WBR, Michael Nemtsev [.NET/C# MVP].
>My blog:http://spaces.live.com/laflour
>Team blog:http://devkids.blogspot.com/
>"The greatest danger for most of us is not that our aim is too high
>and we miss it, but that it is too low and we reach it" (c)
>Michelangelo
>>
Quote:
>>Hi,
>>>
>>Can anyone tell me how to get the ID's and text from all the labels,
>>textboxes, checkboxes, buttons, etc in a form? This needs to be in
>>VB, not C#.
>>>
>>Thanks!
>>Steve- Hide quoted text -
>- Show quoted text -
>>
================================================== ====================
===================================
>
================================================== ====================
===================================
>
I guess I should have said that I am new to VB.Net ... how do I do
that? Do you have a code example?
>
Thanks,
Steve

Closed Thread