?
Solved

Accessing textboxes within a groupbox

Posted on 2003-12-03
10
Medium Priority
?
305 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 2000 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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.   …
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

650 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