473,473 Members | 1,923 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CheckBox Change Event

I have entered some code in the CheckBox CheckChanged event, but it does not
seem to be function. I want to run some code when the check box is changed,
and code run depending on it's checked or unchecked state.

Private Sub chkLeg1Won_CheckedChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles chkLeg1Won.CheckedChanged
If chkLeg1Won.Checked = True Then
[code option 1]
Else
[code option 2]
End If
End Sub

Currently this does not work - can anyone explain why?

This must be relevant...... I have a button on the web form at present that
I am just using for testing something else. Whenever this is clicked, the
code branch of the above code fires. There is no mention of the checkbox in
the Button_click event????????
Nov 19 '05 #1
1 1469
Do you have the AutoPostBack set to True on the Checkbox?

/Lars

"Paul Smith" <pw*@twelve.me.uk> wrote in message
news:42***********************@ptn-nntp-reader04.plus.net...
I have entered some code in the CheckBox CheckChanged event, but it does
not seem to be function. I want to run some code when the check box is
changed, and code run depending on it's checked or unchecked state.

Private Sub chkLeg1Won_CheckedChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles chkLeg1Won.CheckedChanged
If chkLeg1Won.Checked = True Then
[code option 1]
Else
[code option 2]
End If
End Sub

Currently this does not work - can anyone explain why?

This must be relevant...... I have a button on the web form at present
that I am just using for testing something else. Whenever this is
clicked, the code branch of the above code fires. There is no mention of
the checkbox in the Button_click event????????

Nov 19 '05 #2

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

Similar topics

6
by: AFN | last post by:
I want to click a checkbox and have a 4 line (approx) paragraph appear beneath the checkbox, pushing the rest of the page down. And when unchecking the checkbox, the paragraph should disappear...
17
by: jdph40 | last post by:
Question 1: In Access 97, I have a form (frmVacationWeeks) with a subform (sbfrmPostVacDates). The subform can have up to 33 records and each record has 2 checkboxes, one for approved and one for...
3
by: Julius Fenata | last post by:
Dear all, I have checkbox on my webform, and I want that when I click my checkbox, it should change status between true or false... Here is my code, // Code Behind CheckBox1.Attributes =...
4
by: SJ | last post by:
Hi all, I have come across a weird problem when attempting to automatically set the focus in a vb.net form to a checkbox control... In my form I have (on a tab page in a tab control) several...
4
by: | last post by:
I have a checkbox on a web page. When it is checked, I want a Table to appear (or disappear when the checkbox is cleared)... I was hoping to use client side code for this, so I created a short...
4
by: Matrixreloadedth | last post by:
How to change disable color of Checkbox??? I have a checkbox with forecolor in red but when i disable by set Enable properties to false forecolor is changed to gray color but i don't want it. how...
8
by: Sid | last post by:
I hope someone could help me with this. I am trying to setup a criteria to decide when to allow/not allow user to click on the check box. logically it looks simple but I am not able to...
8
by: Grorange | last post by:
Writing ASP.NET pages, I have a need for client-side functions to prevent going to the server for every small change. I have a list of server side created checkboxes filled with a lot of...
2
by: =?Utf-8?B?UmljaA==?= | last post by:
Is there a cancel argument for cancelling if you want to check or uncheck a checkbox? In the checkChanged event of a checkbox I ask the user if they are sure they want to check/uncheck...
3
by: Patrick | last post by:
Hi, Newbish on JS here. Found this script on the web and it does what I want in FF, but works oddly in IE. When I check the box in IE nothing happens, but when I click on the body after the box...
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...
1
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...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.