Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Msgbox on validation appears many times

Posted on 2007-03-19
6
Medium Priority
?
241 Views
Last Modified: 2010-08-05
I have 2 sets of radio buttons  where value choosen in 1 set is  dependent
on the other set.

In buttonselectionchanged  event I have the code to throw an exception if value choosen is wrong and then in catch handler I show that message. But its getting called 2-3 times...showing message box 2-3 times...

How can we avoid  this....
0
Comment
Question by:rishaan
[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
6 Comments
 
LVL 6

Expert Comment

by:kerryw60
ID: 18751360
Can we see your code?
0
 
LVL 64

Expert Comment

by:Fernando Soto
ID: 18751639
It would help to see your code?
0
 

Author Comment

by:rishaan
ID: 18752008
       private void SelectedRecord1_Changed(object sender, System.EventArgs e)
        {
            if (!processEvents)
            {
                return;
            }

          try
             {
                if ((rb1h.Checked) && (rb2.Checked))
                {
                    throw new ApplicationException("Message 1");
                }

                if ((rb1.Checked) && ((rb2.Checked) | (rb3.Checked)))
                {
                   
                    throw new ApplicationException("Message 2");

                }

            catch (Exception ex)
            {
                ShowError("ABC", ex.Message);
            }
           
        }
0
Amazon Web Services EC2 Cheat Sheet

AWS EC2 is a core part of AWS’s cloud platform, allowing users to spin up virtual machines for a variety of tasks; however, EC2’s offerings can be overwhelming. Learn the basics with our new AWS cheat sheet – this time on EC2!

 

Author Comment

by:rishaan
ID: 18752034
This method is called on selection changed event of rb1,rb2,rb3 etc...
After showing the message again this procedure is called..


Similarly with combobox...
0
 
LVL 3

Accepted Solution

by:
Kate12 earned 1400 total points
ID: 18753731
Try hooking up the rb1, rb2 and rb3 "Click" event and not selection changed.
0
 
LVL 2

Assisted Solution

by:Peter Skov
Peter Skov earned 600 total points
ID: 18754505
And do have a look at the Validate event too.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

704 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