473,394 Members | 1,817 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,394 software developers and data experts.

default click behavior of radio button on showing child form

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
May 4 '07 #1
2 2865
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]
- mv*@spam.guard.caspershouse.com

<Petedwrote in message news:dd********************************@4ax.com...
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

May 4 '07 #2
thanks for the info

On Fri, 4 May 2007 15:19:06 -0400, "Nicholas Paldino [.NET/C# MVP]"
<mv*@spam.guard.caspershouse.comwrote:
>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.
May 8 '07 #3

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

Similar topics

4
by: John | last post by:
Could anyone please help me on this?? I have a php script page, which is basically quiz. Visitors (after login in with their email address) are supposed to answer each question, and when they...
1
by: David Wake | last post by:
I have two radio buttons and two checkboxes in a form. I'm trying to write some code so that when a radio button is selected, its corresponding checkbox is disabled. My code looks like this: ...
7
by: steve | last post by:
Hi all If I use this code <% If Request.Item("col")="firstcoll" Then Response.Write "Checked"%> in .aspx page for example like that <input type="radio" name="col" value="firstcoll" <% If...
3
by: steve | last post by:
Sorry if I have post this two times. Hi all What I'm trying to achieve is: I have a form with two radio buttons, if a visitors check radio button 2 and click submit in the next page radio...
6
by: HD | last post by:
Hi. I have an asp page with radio buttons and a combobox... when the user clicks a radio button, I want the form to submit so I can execute the ASP code in order to change the list shown in the...
6
by: J.A.Rank | last post by:
Hello all. I wrote a client-side form evaluation script that runs as expected in Firefox, Netscape, and IE for PC, but fails in IE for Mac. The formEval() method is called from the onSubmit...
3
by: Amelyan | last post by:
When we want radio button to belong to a group name we say, radio1.GroupName="GroupA". In this case, radio1 will be unselected if another radio button is selected in "GroupA". Is there a way...
2
by: Advo | last post by:
Basically, ive got information in a table for the layout purposes, as its text for a questionnaire What i Need, is for instance when the user click a radio button, that information can be...
2
by: runway27 | last post by:
i am using a self submitting form <form action="<?php echo $_SERVER; ?>" method="POST" id="test2" name="test1"> i need to do a validation of textfields, checkboxes, radio buttons i am able...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.