Solved

Accessing textboxes within a groupbox

Posted on 2003-12-03
10
301 Views
Last Modified: 2012-05-04
Hello,
I have a groupbox with two textboxes within it. I need to determine if they have been modified. How can I do this?
0
Comment
Question by:caddsman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
10 Comments
 
LVL 1

Author Comment

by:caddsman
ID: 9869314
For clarification, how do I access the textboxes within the groupbox and determine if those textboxes have been modified?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9869317
If you know there only text boxes in the group box, you could loop through each text box in the group box controls:

      Dim ctl As TextBox
      Dim WasChanged As Boolean

      For Each ctl In Me.GroupBox1.Controls

         WasChanged = ctl.Modified

      Next
0
 
LVL 42

Accepted Solution

by:
frodoman earned 500 total points
ID: 9869348
If you're trying to find out if any of the text boxes have been changed, then the only problem with above code is that WasChanged will take on the value of the last text box in the group.

Instead you might consider:

      Dim ctl As TextBox
      Dim WasChanged As Boolean = False

      For Each ctl In Me.GroupBox1.Controls
         If ctl.Modified then
            WasChanged = True
            Exit For
         End if
      Next

0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 96

Expert Comment

by:Bob Learned
ID: 9869369
That's what you get for 5 minutes of coding in the comment block without testing.
0
 
LVL 42

Expert Comment

by:frodoman
ID: 9869431
Well, we've all done that 1 or 2 (thousand) times ;-)
0
 
LVL 1

Author Comment

by:caddsman
ID: 9869850
Oops, sorry frodoman. I meant to give yo the points. :(
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9869896
You can always have a moderator fix this.  Ask in Community Support to have this question fixed.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9870181
You might also think about splitting the points.  If one person starts and idea, and another fixes any problems, then you can say that my comments was an 'Assisted' comment.
0
 
LVL 42

Expert Comment

by:frodoman
ID: 9870229
caddsman,

I'm all for splitting the points on this one.  TheLearnedOne rang in first with the basic code - I just fixed a simple logic error in the algorythm.

Cheers,

Frodoman
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question