473,406 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Clear Multiple controls at the same time

Hello everybody,

I heard I could clear (or move spaces) to all controls at ones without
having to call each one of them. If someone remembers how to do that, I will
apreciate your help.

My scenario is a form where I have multiples groupboxes, and in each of
those groups i have text boxes, where users enter data. And I want to have
an option where the user can clear the controls in particular group at once.
And I do not want to be calling for each one of the controls for that
process.
I used to move spaces to each one of them like this:

text1.text = ""
text2.text=""
text3.text = ""
....
textn.text = ""

but there are a lot of controls in this application.
Thanks for any good suggestions.

Edd
Nov 21 '05 #1
7 3121
Eduardo78 wrote:
Hello everybody,

I heard I could clear (or move spaces) to all controls at ones without
having to call each one of them. If someone remembers how to do that, I will
apreciate your help.

My scenario is a form where I have multiples groupboxes, and in each of
those groups i have text boxes, where users enter data. And I want to have
an option where the user can clear the controls in particular group at once.
And I do not want to be calling for each one of the controls for that
process.
I used to move spaces to each one of them like this:

text1.text = ""
text2.text=""
text3.text = ""
...
textn.text = ""

but there are a lot of controls in this application.
Thanks for any good suggestions.

Edd


For each Ctr as Control in GroupBox.Controls
Ctr.Text = ""
Next

This should work.
Chris
Nov 21 '05 #2
Eduardo,

Try this where "me" is your form:

Me.Controls.Clear()

Curtis

"Eduardo78" <Ed*******@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
Hello everybody,

I heard I could clear (or move spaces) to all controls at ones without
having to call each one of them. If someone remembers how to do that, I
will
apreciate your help.

My scenario is a form where I have multiples groupboxes, and in each of
those groups i have text boxes, where users enter data. And I want to
have
an option where the user can clear the controls in particular group at
once.
And I do not want to be calling for each one of the controls for that
process.
I used to move spaces to each one of them like this:

text1.text = ""
text2.text=""
text3.text = ""
...
textn.text = ""

but there are a lot of controls in this application.
Thanks for any good suggestions.

Edd

Nov 21 '05 #3
Thanks a lot Chris, it worked good, but it also cleared the labels on that
groupbox, how could I make it to clear just the textboxes?

"Chris" wrote:
Eduardo78 wrote:
Hello everybody,

I heard I could clear (or move spaces) to all controls at ones without
having to call each one of them. If someone remembers how to do that, I will
apreciate your help.

My scenario is a form where I have multiples groupboxes, and in each of
those groups i have text boxes, where users enter data. And I want to have
an option where the user can clear the controls in particular group at once.
And I do not want to be calling for each one of the controls for that
process.
I used to move spaces to each one of them like this:

text1.text = ""
text2.text=""
text3.text = ""
...
textn.text = ""

but there are a lot of controls in this application.
Thanks for any good suggestions.

Edd


For each Ctr as Control in GroupBox.Controls
Ctr.Text = ""
Next

This should work.
Chris

Nov 21 '05 #4
Eduardo78 wrote:
Thanks a lot Chris, it worked good, but it also cleared the labels on that
groupbox, how could I make it to clear just the textboxes?

"Chris" wrote:

Eduardo78 wrote:
Hello everybody,

I heard I could clear (or move spaces) to all controls at ones without
having to call each one of them. If someone remembers how to do that, I will
apreciate your help.

My scenario is a form where I have multiples groupboxes, and in each of
those groups i have text boxes, where users enter data. And I want to have
an option where the user can clear the controls in particular group at once.
And I do not want to be calling for each one of the controls for that
process.
I used to move spaces to each one of them like this:

text1.text = ""
text2.text=""
text3.text = ""
...
textn.text = ""

but there are a lot of controls in this application.
Thanks for any good suggestions.

Edd


For each Ctr as Control in GroupBox.Controls
Ctr.Text = ""
Next

This should work.
Chris


Blah... Ya, sorry about that...

For each Ctr as Control in GroupBox.Controls
if Typeof Ctr is TextBox then
Ctr.Text = ""
End if
Next
Nov 21 '05 #5
Curtis wrote:
Eduardo,

Try this where "me" is your form:

Me.Controls.Clear()

Curtis

"Eduardo78" <Ed*******@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
Hello everybody,

I heard I could clear (or move spaces) to all controls at ones without
having to call each one of them. If someone remembers how to do that, I
will
apreciate your help.

My scenario is a form where I have multiples groupboxes, and in each of
those groups i have text boxes, where users enter data. And I want to
have
an option where the user can clear the controls in particular group at
once.
And I do not want to be calling for each one of the controls for that
process.
I used to move spaces to each one of them like this:

text1.text = ""
text2.text=""
text3.text = ""
...
textn.text = ""

but there are a lot of controls in this application.
Thanks for any good suggestions.

Edd



Um, that would remove all the controls from his form... That's not what
he is trying to do.

Chris
Nov 21 '05 #6
Thanks Curtis, but that command clears evething in the form. I just want to
clear the textboxes in a specific groupbox in the form.

Thanks,

Eduardo

"Curtis" wrote:
Eduardo,

Try this where "me" is your form:

Me.Controls.Clear()

Curtis

"Eduardo78" <Ed*******@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
Hello everybody,

I heard I could clear (or move spaces) to all controls at ones without
having to call each one of them. If someone remembers how to do that, I
will
apreciate your help.

My scenario is a form where I have multiples groupboxes, and in each of
those groups i have text boxes, where users enter data. And I want to
have
an option where the user can clear the controls in particular group at
once.
And I do not want to be calling for each one of the controls for that
process.
I used to move spaces to each one of them like this:

text1.text = ""
text2.text=""
text3.text = ""
...
textn.text = ""

but there are a lot of controls in this application.
Thanks for any good suggestions.

Edd


Nov 21 '05 #7
Thanks Curtis, but that command clears evething in the form. I just want to
clear the textboxes in a specific groupbox in the form.

Thanks,

Eduardo

"Curtis" wrote:
Eduardo,
"Chris" wrote:
Curtis wrote:
Eduardo,

Try this where "me" is your form:

Me.Controls.Clear()

Curtis

"Eduardo78" <Ed*******@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
Hello everybody,

I heard I could clear (or move spaces) to all controls at ones without
having to call each one of them. If someone remembers how to do that, I
will
apreciate your help.

My scenario is a form where I have multiples groupboxes, and in each of
those groups i have text boxes, where users enter data. And I want to
have
an option where the user can clear the controls in particular group at
once.
And I do not want to be calling for each one of the controls for that
process.
I used to move spaces to each one of them like this:

text1.text = ""
text2.text=""
text3.text = ""
...
textn.text = ""

but there are a lot of controls in this application.
Thanks for any good suggestions.

Edd



Um, that would remove all the controls from his form... That's not what
he is trying to do.

Chris

Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: kanones | last post by:
Hi I have a placeholder that has multiple controls that need to be loaded and rendered to the user based on some user selections. I have to loop through the choices that the user makes and then...
3
by: TT (Tom Tempelaere) | last post by:
Hi there, In my application I have a panel that contains a matrix of user controls. The user control is fairly simple. It merely draws a circle that represents an object in my code. The object...
0
by: Jeff Tolman | last post by:
Hi! I keep getting this error, but I'm not sure why. When I turn off the trace flag, I only get it at certain times. Even with the trace flag set to true, I don't understand the output...
2
by: Anders Borum | last post by:
Hello! I'm building pages dynamically, by loading usercontrols recursively and adding the to eachother. My problem is usercontrols - defined with output-caching directives. When these...
2
by: Bal Ghuman | last post by:
Hi Guys I've got an ASP.NET application that dynamically creates a navigation table from an XML file and then Loads a user control according to which link has been selected. The control...
0
by: PB | last post by:
According to the documentation, ParseControl returns a parsed control from an input string. The documentation seems to assume that *one* control will be parsed from the string. My implementation...
3
by: Nathan Sokalski | last post by:
When I view any page in my application a second time, I recieve the following error: System.Web.TraceContext.AddNewControl(String id, String parentId, String type, Int32 viewStateSize) +313...
6
imrosie
by: imrosie | last post by:
Hello, Does anyone have a simple cmd to clear all controls on Subform without using the SetFocus? Two of the controls are expressions, so they can't be set to Null. Then after clear return control...
3
by: =?Utf-8?B?a3dvbmd0aw==?= | last post by:
error message found in server A "Multiple controls with the same ID 'batchEndorseworklist' were found. Trace requires that controls have unique IDs." but in server B is normal why? thank you
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.