473,396 Members | 2,154 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,396 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 2866
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.