473,945 Members | 32,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CheckedChanged event - how do I make it work?

It seems that the following code should work - (if not why is the event there?)
(Do I need some sort of client side script to awaken it?)

Private Sub chkRefresh_Chec kedChanged(ByVa l sender As System.Object, ByVal e
As System.EventArg s) Handles chkRefresh.Chec kedChanged
If chkRefresh.Chec ked = True Then
Me.txtRefreshDa te.Text = ""
Me.txtRefreshDa te.Enabled = False
Else
Me.txtRefreshDa te.Enabled = True
End If
End Sub
May 29 '06 #1
6 1699
Hello, jonefer,

The code works fine for me. (I'm assuming that it is in the Form that
contains chkRefresh and txtRefreshDate. )

Can you be more specific about what the problem is.

Cheers,
Randy
jonefer wrote:
It seems that the following code should work - (if not why is the event there?)
(Do I need some sort of client side script to awaken it?)

Private Sub chkRefresh_Chec kedChanged(ByVa l sender As System.Object, ByVal e
As System.EventArg s) Handles chkRefresh.Chec kedChanged
If chkRefresh.Chec ked = True Then
Me.txtRefreshDa te.Text = ""
Me.txtRefreshDa te.Enabled = False
Else
Me.txtRefreshDa te.Enabled = True
End If
End Sub

May 29 '06 #2
That is correct - I'd like it to happen each time the box is checked
(visually) or unchecked.

It is a control panel for an administrative user of the website.
This portion is what will automatically put up a 'not available' page
whenever data is being refreshed.
The user has 2 choices
1. Check the Refresh Checkbox - and provide the time that the site will be
available again.
or
2. Uncheck the box, in which case the 'Refresh date' should have a valid
date in the past.
that the user enters.

More explicitly, I'm inserting a date of "#1/1/2207#' into the actual
(txtRefreshdate ) field whenever the box is checked - and hiding that effect
from the user - that date is my cue to put up a 'Not Available' page.

If the user unchecks the box - only then do I want the txtRefreshDate to be
available.

Checking and unchecking the box must visually cue the user what is available.
And I can't seem to make that work.

when the box is checked - they should only see a 'Time Available' box
when the box is unchecked - they should only see a 'Refresh Date' box

THEN the user can click 'submit'


"R. MacDonald" wrote:
Hello, jonefer,

The code works fine for me. (I'm assuming that it is in the Form that
contains chkRefresh and txtRefreshDate. )

Can you be more specific about what the problem is.

Cheers,
Randy
jonefer wrote:
It seems that the following code should work - (if not why is the event there?)
(Do I need some sort of client side script to awaken it?)

Private Sub chkRefresh_Chec kedChanged(ByVa l sender As System.Object, ByVal e
As System.EventArg s) Handles chkRefresh.Chec kedChanged
If chkRefresh.Chec ked = True Then
Me.txtRefreshDa te.Text = ""
Me.txtRefreshDa te.Enabled = False
Else
Me.txtRefreshDa te.Enabled = True
End If
End Sub

May 29 '06 #3
Hello, jonefer,

Sorry, but I haven't done any work with web pages. Is the problem that
the event handler does not get called when the check box state is changed?

Cheers,
Randy
jonefer wrote:
That is correct - I'd like it to happen each time the box is checked
(visually) or unchecked.

It is a control panel for an administrative user of the website.
This portion is what will automatically put up a 'not available' page
whenever data is being refreshed.
The user has 2 choices
1. Check the Refresh Checkbox - and provide the time that the site will be
available again.
or
2. Uncheck the box, in which case the 'Refresh date' should have a valid
date in the past.
that the user enters.

More explicitly, I'm inserting a date of "#1/1/2207#' into the actual
(txtRefreshdate ) field whenever the box is checked - and hiding that effect
from the user - that date is my cue to put up a 'Not Available' page.

If the user unchecks the box - only then do I want the txtRefreshDate to be
available.

Checking and unchecking the box must visually cue the user what is available.
And I can't seem to make that work.

when the box is checked - they should only see a 'Time Available' box
when the box is unchecked - they should only see a 'Refresh Date' box

THEN the user can click 'submit'


"R. MacDonald" wrote:

Hello, jonefer,

The code works fine for me. (I'm assuming that it is in the Form that
contains chkRefresh and txtRefreshDate. )

Can you be more specific about what the problem is.

Cheers,
Randy
jonefer wrote:
It seems that the following code should work - (if not why is the event there?)
(Do I need some sort of client side script to awaken it?)

Private Sub chkRefresh_Chec kedChanged(ByVa l sender As System.Object, ByVal e
As System.EventArg s) Handles chkRefresh.Chec kedChanged
If chkRefresh.Chec ked = True Then
Me.txtRefreshDa te.Text = ""
Me.txtRefreshDa te.Enabled = False
Else
Me.txtRefreshDa te.Enabled = True
End If
End Sub

May 29 '06 #4
Yes. The problem is that nothing happens when the checkbox gets changed.
I only notice it when the page first opens.

"R. MacDonald" wrote:
Hello, jonefer,

Sorry, but I haven't done any work with web pages. Is the problem that
the event handler does not get called when the check box state is changed?

Cheers,
Randy
jonefer wrote:
That is correct - I'd like it to happen each time the box is checked
(visually) or unchecked.

It is a control panel for an administrative user of the website.
This portion is what will automatically put up a 'not available' page
whenever data is being refreshed.
The user has 2 choices
1. Check the Refresh Checkbox - and provide the time that the site will be
available again.
or
2. Uncheck the box, in which case the 'Refresh date' should have a valid
date in the past.
that the user enters.

More explicitly, I'm inserting a date of "#1/1/2207#' into the actual
(txtRefreshdate ) field whenever the box is checked - and hiding that effect
from the user - that date is my cue to put up a 'Not Available' page.

If the user unchecks the box - only then do I want the txtRefreshDate to be
available.

Checking and unchecking the box must visually cue the user what is available.
And I can't seem to make that work.

when the box is checked - they should only see a 'Time Available' box
when the box is unchecked - they should only see a 'Refresh Date' box

THEN the user can click 'submit'


"R. MacDonald" wrote:

Hello, jonefer,

The code works fine for me. (I'm assuming that it is in the Form that
contains chkRefresh and txtRefreshDate. )

Can you be more specific about what the problem is.

Cheers,
Randy
jonefer wrote:

It seems that the following code should work - (if not why is the event there?)
(Do I need some sort of client side script to awaken it?)

Private Sub chkRefresh_Chec kedChanged(ByVa l sender As System.Object, ByVal e
As System.EventArg s) Handles chkRefresh.Chec kedChanged
If chkRefresh.Chec ked = True Then
Me.txtRefreshDa te.Text = ""
Me.txtRefreshDa te.Enabled = False
Else
Me.txtRefreshDa te.Enabled = True
End If
End Sub

May 29 '06 #5
Hello, jonefer,

Is the AutoPostBack property of the CheckBox set to True? If not, try this.

Cheers,
Randy
jonefer wrote:
Yes. The problem is that nothing happens when the checkbox gets changed.
I only notice it when the page first opens.

"R. MacDonald" wrote:

Hello, jonefer,

Sorry, but I haven't done any work with web pages. Is the problem that
the event handler does not get called when the check box state is changed?

Cheers,
Randy
jonefer wrote:

That is correct - I'd like it to happen each time the box is checked
(visually) or unchecked.

It is a control panel for an administrative user of the website.
This portion is what will automatically put up a 'not available' page
whenever data is being refreshed.
The user has 2 choices
1. Check the Refresh Checkbox - and provide the time that the site will be
available again.
or
2. Uncheck the box, in which case the 'Refresh date' should have a valid
date in the past.
that the user enters.

More explicitly, I'm inserting a date of "#1/1/2207#' into the actual
(txtRefreshd ate) field whenever the box is checked - and hiding that effect
from the user - that date is my cue to put up a 'Not Available' page.

If the user unchecks the box - only then do I want the txtRefreshDate to be
available.

Checking and unchecking the box must visually cue the user what is available.
And I can't seem to make that work.

when the box is checked - they should only see a 'Time Available' box
when the box is unchecked - they should only see a 'Refresh Date' box

THEN the user can click 'submit'


"R. MacDonald" wrote:

Hello, jonefer,

The code works fine for me. (I'm assuming that it is in the Form that
contains chkRefresh and txtRefreshDate. )

Can you be more specific about what the problem is.

Cheers,
Randy
jonefer wrote:
>It seems that the following code should work - (if not why is the event there?)
>(Do I need some sort of client side script to awaken it?)
>
>Private Sub chkRefresh_Chec kedChanged(ByVa l sender As System.Object, ByVal e
>As System.EventArg s) Handles chkRefresh.Chec kedChanged
> If chkRefresh.Chec ked = True Then
> Me.txtRefreshDa te.Text = ""
> Me.txtRefreshDa te.Enabled = False
> Else
> Me.txtRefreshDa te.Enabled = True
> End If
> End Sub

May 30 '06 #6
Hi Randy,
That was it! Thanks.

"R. MacDonald" wrote:
Hello, jonefer,

Is the AutoPostBack property of the CheckBox set to True? If not, try this.

Cheers,
Randy
jonefer wrote:
Yes. The problem is that nothing happens when the checkbox gets changed.
I only notice it when the page first opens.

"R. MacDonald" wrote:

Hello, jonefer,

Sorry, but I haven't done any work with web pages. Is the problem that
the event handler does not get called when the check box state is changed?

Cheers,
Randy
jonefer wrote:
That is correct - I'd like it to happen each time the box is checked
(visually) or unchecked.

It is a control panel for an administrative user of the website.
This portion is what will automatically put up a 'not available' page
whenever data is being refreshed.
The user has 2 choices
1. Check the Refresh Checkbox - and provide the time that the site will be
available again.
or
2. Uncheck the box, in which case the 'Refresh date' should have a valid
date in the past.
that the user enters.

More explicitly, I'm inserting a date of "#1/1/2207#' into the actual
(txtRefreshd ate) field whenever the box is checked - and hiding that effect
from the user - that date is my cue to put up a 'Not Available' page.

If the user unchecks the box - only then do I want the txtRefreshDate to be
available.

Checking and unchecking the box must visually cue the user what is available.
And I can't seem to make that work.

when the box is checked - they should only see a 'Time Available' box
when the box is unchecked - they should only see a 'Refresh Date' box

THEN the user can click 'submit'


"R. MacDonald" wrote:

>Hello, jonefer,
>
>The code works fine for me. (I'm assuming that it is in the Form that
>contains chkRefresh and txtRefreshDate. )
>
>Can you be more specific about what the problem is.
>
>Cheers,
>Randy
>
>
>jonefer wrote:
>
>
>>It seems that the following code should work - (if not why is the event there?)
>>(Do I need some sort of client side script to awaken it?)
>>
>>Private Sub chkRefresh_Chec kedChanged(ByVa l sender As System.Object, ByVal e
>>As System.EventArg s) Handles chkRefresh.Chec kedChanged
>> If chkRefresh.Chec ked = True Then
>> Me.txtRefreshDa te.Text = ""
>> Me.txtRefreshDa te.Enabled = False
>> Else
>> Me.txtRefreshDa te.Enabled = True
>> End If
>> End Sub
>

May 30 '06 #7

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

Similar topics

3
5042
by: boxboy | last post by:
I am hoping someone from Microsoft could shed some insight into this question. Why did microsoft decide to use a verb based naming convtion for events rather such as Close and Click for rather than prepending them with On as in OnClose and OnClick? The way it is now, I encounter a lot of naming conflicts/ambiguity when trying to follow Microsoft's reccommened approach in naming my own events.
3
2162
by: Patrick De Ridder | last post by:
What is the effect of the following line? checkBox1_CheckedChanged(null,null); Thanks, Patrick.
5
3138
by: Greg Hurlman | last post by:
I've got a very simple ASCX page, where once someone finishes a section and clicks the "Next >" button, the section they just finished is disabled, and the next section appears below it, and so on. One of the controls is a checkbox, which, when clicked, displays a hidden panel containing controls whose input are used for filtering query results. If someone checks the checkbox in the first section and clicks the first "Next >" button,...
3
3617
by: Jump Off! | last post by:
Hi, I work with ASP.NET v2 (visual web dev 2005 express) and, when i want to use the CheckedChanged Event of a checkbox, it doesn't work. I want to enable a button when checkbox is checked, and disable the button when it's unchecked. But not working, even if you make other things.
3
4067
by: Piotr Strycharz | last post by:
Hi, I have a Repeater with CheckBox in one of its columns. In ItemDataBound handler I'm doing: chk.CheckedChanged += new EventHandler(chk_CheckedChanged). The chk_CheckedChanged handler is supposed to fire when I click the checkbox. Hoewever - it does not! It does not depend on EnableSessionState, it does not depend on AutoPostBack. simply - does not fire at all. Now - how am I going to know if user selects one of the rows in the...
2
10788
by: dilip.movva | last post by:
Hi, In the ItemDataBound of my datagrid I am creating a checkbox dynamically. I have the eventhandler defined for CheckedChanged of the check box. The event is not firing. The grid is bound in the Page_Prerender method. My code is something like this Private Sub grdMissingData_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles grdMissingData.ItemDataBound If e.Item.ItemType =...
3
4154
by: Alex | last post by:
i got a form with some checkboxes and they are set to be checked on design time... when the program loads it fires the CheckChanged event for every one of them.... there is any way to avoid this?? this is happening before the Load event.... i was thinking on putting a Boolean Variable to avoid this while loading but i think that it has to be a better approach. Thanks. Alex.
9
2484
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the post event will always execuate after the system is completed... - I want to wrap this functionality in a framework, so I could possibly have 3 or 4 levels of inherited objects that need to have these pre / post events executed before and after the...
0
1365
by: Paul | last post by:
Hello, I have a datagridview with a checkbox in a column, and I want to detect when the user change the value of the checkbox in the event CheckedChanged, but I only detect that the value is changed when the focus is in another column. An idea? Thanks
0
11548
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11140
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10679
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8239
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7402
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4520
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3523
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.