473,396 Members | 1,913 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.

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_CheckedChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles chkRefresh.CheckedChanged
If chkRefresh.Checked = True Then
Me.txtRefreshDate.Text = ""
Me.txtRefreshDate.Enabled = False
Else
Me.txtRefreshDate.Enabled = True
End If
End Sub
May 29 '06 #1
6 1678
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_CheckedChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles chkRefresh.CheckedChanged
If chkRefresh.Checked = True Then
Me.txtRefreshDate.Text = ""
Me.txtRefreshDate.Enabled = False
Else
Me.txtRefreshDate.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_CheckedChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles chkRefresh.CheckedChanged
If chkRefresh.Checked = True Then
Me.txtRefreshDate.Text = ""
Me.txtRefreshDate.Enabled = False
Else
Me.txtRefreshDate.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_CheckedChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles chkRefresh.CheckedChanged
If chkRefresh.Checked = True Then
Me.txtRefreshDate.Text = ""
Me.txtRefreshDate.Enabled = False
Else
Me.txtRefreshDate.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_CheckedChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles chkRefresh.CheckedChanged
If chkRefresh.Checked = True Then
Me.txtRefreshDate.Text = ""
Me.txtRefreshDate.Enabled = False
Else
Me.txtRefreshDate.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
(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_CheckedChanged(ByVal sender As System.Object, ByVal e
>As System.EventArgs) Handles chkRefresh.CheckedChanged
> If chkRefresh.Checked = True Then
> Me.txtRefreshDate.Text = ""
> Me.txtRefreshDate.Enabled = False
> Else
> Me.txtRefreshDate.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
(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_CheckedChanged(ByVal sender As System.Object, ByVal e
>>As System.EventArgs) Handles chkRefresh.CheckedChanged
>> If chkRefresh.Checked = True Then
>> Me.txtRefreshDate.Text = ""
>> Me.txtRefreshDate.Enabled = False
>> Else
>> Me.txtRefreshDate.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
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...
3
by: Patrick De Ridder | last post by:
What is the effect of the following line? checkBox1_CheckedChanged(null,null); Thanks, Patrick.
5
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....
3
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,...
3
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...
2
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...
3
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??...
9
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...
0
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...
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: 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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.