PC Review


Reply
Thread Tools Rate Thread

default click behavior of radio button on showing child form

 
 
Peted
Guest
Posts: n/a
 
      4th May 2007
Hi

Im using c# express edition 2005


I have an MDI form, where i load multiple child forms from a dll i
create, using reflection and late binding

The child forms have multiple radio buttons in a groupbox, and have
the appearence set to button

My problem is, they have functions that are in thier click events, but
every time i hide then show, make visible a child form the click event
from the last selected radio button fires off.

I need the click event only to fire on an actual click and not when
the child form is hide then show.

When the child form is opened for the first time the radio button with
tab index 0 fires , then its the last selected radio button


any help appreciated on how i can stop this auto click on showing the
child form


thanks

Peted
 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      4th May 2007
Peted,

This is the expected behavior, unfortunately.

The best solution I can think of is to have a flag that you set when you
don't want the event handler code to fire (like when the form is being
shown, etc, etc) and then set it when you perform your action. When done,
set the flag back.

Then, in your click event handler, check the flag. If it is set, exit
the method, otherwise, process normally.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

<Peted> wrote in message news:(E-Mail Removed)...
> Hi
>
> Im using c# express edition 2005
>
>
> I have an MDI form, where i load multiple child forms from a dll i
> create, using reflection and late binding
>
> The child forms have multiple radio buttons in a groupbox, and have
> the appearence set to button
>
> My problem is, they have functions that are in thier click events, but
> every time i hide then show, make visible a child form the click event
> from the last selected radio button fires off.
>
> I need the click event only to fire on an actual click and not when
> the child form is hide then show.
>
> When the child form is opened for the first time the radio button with
> tab index 0 fires , then its the last selected radio button
>
>
> any help appreciated on how i can stop this auto click on showing the
> child form
>
>
> thanks
>
> Peted



 
Reply With Quote
 
Peted
Guest
Posts: n/a
 
      8th May 2007
thanks for the info



On Fri, 4 May 2007 15:19:06 -0400, "Nicholas Paldino [.NET/C# MVP]"
<(E-Mail Removed)> wrote:

>Peted,
>
> This is the expected behavior, unfortunately.
>
> The best solution I can think of is to have a flag that you set when you
>don't want the event handler code to fire (like when the form is being
>shown, etc, etc) and then set it when you perform your action. When done,
>set the flag back.
>
> Then, in your click event handler, check the flag. If it is set, exit
>the method, otherwise, process normally.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing form region on button click umasgade@gmail.com Microsoft Outlook Program Addins 1 7th Feb 2008 03:17 PM
Re: HOW DO ON CLICK OF BUTTON IN MDI PARENT I CALL A FUNCTION IN CHILD FORM Herfried K. Wagner [MVP] Microsoft VB .NET 0 17th Nov 2004 12:12 PM
select default radio button in form steve Microsoft ASP .NET 2 10th Nov 2004 01:25 PM
Re: HOW DO ON CLICK OF BUTTON IN MDI PARENT I CALL A FUNCTION IN CHILD FORM Herfried K. Wagner [MVP] Microsoft VB .NET 0 17th Oct 2004 11:47 AM
Survey with radio-button-like range behavior Laurent Microsoft Excel Worksheet Functions 3 29th Jan 2004 08:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:55 AM.