By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,127 Members | 1,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,127 IT Pros & Developers. It's quick & easy.

CheckedListbox - change check event

P: n/a
Hi

Can't believe I've not been able to find the answer to this in the on-line
help.

I have a CheckedListBox which, via a timer control, is populated with the
names of files in a network folder. The "check mark" for each item in the
control is determined by the boolean value of a custom property field of the
file. That value is found using microsoft's dsofile.dll class.

That's the background. What's the problem?....there doesn't seem to be any
"checked change" event for the CheckedListBox control. If my user changes the
check mark on one of the items in the CheckedListBox I want to trigger a
procedure to change the value of the file's custom property field

Changing the value is the easy bit, its all written and waiting to
go.....but I can't find a way to trigger the procedure when the check is
changed

Am I missing something ?

Any help would be appreciated

Thanks

Michael Bond
Jul 6 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"mabond" <ma****@discussions.microsoft.comwrote in message news:7A**********************************@microsof t.com...
Hi

Can't believe I've not been able to find the answer to this in the on-line
help.

I have a CheckedListBox which, via a timer control, is populated with the
names of files in a network folder. The "check mark" for each item in the
control is determined by the boolean value of a custom property field of the
file. That value is found using microsoft's dsofile.dll class.

That's the background. What's the problem?....there doesn't seem to be any
"checked change" event for the CheckedListBox control. If my user changes the
check mark on one of the items in the CheckedListBox I want to trigger a
procedure to change the value of the file's custom property field

Changing the value is the easy bit, its all written and waiting to
go.....but I can't find a way to trigger the procedure when the check is
changed

Am I missing something ?

Any help would be appreciated

Thanks

Michael Bond
Did you try the ItemCheck event?
"Occurs when the checked state of an item changes"

--
Al Reid
Jul 6 '06 #2

P: n/a
Al

thanks for the reply ....... firstly no, I hadn't tried it (I did say I
thought there would be something I was missing!)

However, having found the event that I need it's now given me an entirely
different problem! Because I re-populate the control with a timer event, the
itemcheck event for every item in the box is being triggered every time the
control is refreshed (logical of course 'cos thats is what I've told it to
do!)

So it's abck to the drawing board and a re-think of my methodolgy for
dealing with this requirement.

Thanks again

Michael Bond
I believe under different circumstances that event would be what I n

"Al Reid" wrote:
"mabond" <ma****@discussions.microsoft.comwrote in message news:7A**********************************@microsof t.com...
Hi

Can't believe I've not been able to find the answer to this in the on-line
help.

I have a CheckedListBox which, via a timer control, is populated with the
names of files in a network folder. The "check mark" for each item in the
control is determined by the boolean value of a custom property field of the
file. That value is found using microsoft's dsofile.dll class.

That's the background. What's the problem?....there doesn't seem to be any
"checked change" event for the CheckedListBox control. If my user changes the
check mark on one of the items in the CheckedListBox I want to trigger a
procedure to change the value of the file's custom property field

Changing the value is the easy bit, its all written and waiting to
go.....but I can't find a way to trigger the procedure when the check is
changed

Am I missing something ?

Any help would be appreciated

Thanks

Michael Bond

Did you try the ItemCheck event?
"Occurs when the checked state of an item changes"

--
Al Reid
Jul 6 '06 #3

P: n/a
When changing the checked status, you can "remove" the event handler then
"Add" it back when you are finished. I use the following for a similiar
situation when I am using the treeview control:

RemoveHandler tre_MusicSource.AfterCheck, AddressOf tre_MusicSource_AfterCheck

.....do your thing here

AddHandler tre_MusicSource.AfterCheck, AddressOf tre_MusicSource_AfterCheck
Dennis in Houston

Note: the sub "tre_MusicSource_AfterCheck is the name of the sub that
handles the check event for the treeveiw control named tre_MusicSource.

Hope this helps as I find this technique very useful.
"mabond" wrote:
Al

thanks for the reply ....... firstly no, I hadn't tried it (I did say I
thought there would be something I was missing!)

However, having found the event that I need it's now given me an entirely
different problem! Because I re-populate the control with a timer event, the
itemcheck event for every item in the box is being triggered every time the
control is refreshed (logical of course 'cos thats is what I've told it to
do!)

So it's abck to the drawing board and a re-think of my methodolgy for
dealing with this requirement.

Thanks again

Michael Bond
I believe under different circumstances that event would be what I n

"Al Reid" wrote:
"mabond" <ma****@discussions.microsoft.comwrote in message news:7A**********************************@microsof t.com...
Hi
>
Can't believe I've not been able to find the answer to this in the on-line
help.
>
I have a CheckedListBox which, via a timer control, is populated with the
names of files in a network folder. The "check mark" for each item in the
control is determined by the boolean value of a custom property field of the
file. That value is found using microsoft's dsofile.dll class.
>
That's the background. What's the problem?....there doesn't seem to be any
"checked change" event for the CheckedListBox control. If my user changes the
check mark on one of the items in the CheckedListBox I want to trigger a
procedure to change the value of the file's custom property field
>
Changing the value is the easy bit, its all written and waiting to
go.....but I can't find a way to trigger the procedure when the check is
changed
>
Am I missing something ?
>
Any help would be appreciated
>
Thanks
>
Michael Bond
Did you try the ItemCheck event?
"Occurs when the checked state of an item changes"

--
Al Reid

Jul 6 '06 #4

P: n/a
Remove your event handler while populating the list and add it back in when
you're done.

Public Sub MyTimerEventHandler(...)
RemoveHandler myListBox.ItemCheck, AddressOf MyItemCheckEventHandler
' Do your stuff
AddHandler myListBox.ItemCheck, AddressOf MyItemCheckEventHandler
End Sub

/claes

"mabond" <ma****@discussions.microsoft.comwrote in message
news:08**********************************@microsof t.com...
Al

thanks for the reply ....... firstly no, I hadn't tried it (I did say I
thought there would be something I was missing!)

However, having found the event that I need it's now given me an entirely
different problem! Because I re-populate the control with a timer event,
the
itemcheck event for every item in the box is being triggered every time
the
control is refreshed (logical of course 'cos thats is what I've told it to
do!)

So it's abck to the drawing board and a re-think of my methodolgy for
dealing with this requirement.

Thanks again

Michael Bond
I believe under different circumstances that event would be what I n

"Al Reid" wrote:
>"mabond" <ma****@discussions.microsoft.comwrote in message
news:7A**********************************@microso ft.com...
Hi

Can't believe I've not been able to find the answer to this in the
on-line
help.

I have a CheckedListBox which, via a timer control, is populated with
the
names of files in a network folder. The "check mark" for each item in
the
control is determined by the boolean value of a custom property field
of the
file. That value is found using microsoft's dsofile.dll class.

That's the background. What's the problem?....there doesn't seem to be
any
"checked change" event for the CheckedListBox control. If my user
changes the
check mark on one of the items in the CheckedListBox I want to trigger
a
procedure to change the value of the file's custom property field

Changing the value is the easy bit, its all written and waiting to
go.....but I can't find a way to trigger the procedure when the check
is
changed

Am I missing something ?

Any help would be appreciated

Thanks

Michael Bond

Did you try the ItemCheck event?
"Occurs when the checked state of an item changes"

--
Al Reid

Jul 6 '06 #5

P: n/a
Dennis

thanks for the reply .......

In the meantime I had a re-think on my technique.

My CheckedListBox was refreshing with the timer every 1000 ms. This was to
ensure the user (and there are more than one at any given time) would see the
most up to date content of the network folder in question. I've now replaced
the timer event with a filesystem watcher. In that way the CheckedListBox
only refreshes in the event of a change to the folder or any of its contents
and not every second.

Thanks to you and to Al for helping out with suggestions. Much appreciate
the help

Regards

Michael Bond
"Dennis" wrote:
When changing the checked status, you can "remove" the event handler then
"Add" it back when you are finished. I use the following for a similiar
situation when I am using the treeview control:

RemoveHandler tre_MusicSource.AfterCheck, AddressOf tre_MusicSource_AfterCheck

....do your thing here

AddHandler tre_MusicSource.AfterCheck, AddressOf tre_MusicSource_AfterCheck
Dennis in Houston

Note: the sub "tre_MusicSource_AfterCheck is the name of the sub that
handles the check event for the treeveiw control named tre_MusicSource.

Hope this helps as I find this technique very useful.
"mabond" wrote:
Al

thanks for the reply ....... firstly no, I hadn't tried it (I did say I
thought there would be something I was missing!)

However, having found the event that I need it's now given me an entirely
different problem! Because I re-populate the control with a timer event, the
itemcheck event for every item in the box is being triggered every time the
control is refreshed (logical of course 'cos thats is what I've told it to
do!)

So it's abck to the drawing board and a re-think of my methodolgy for
dealing with this requirement.

Thanks again

Michael Bond
I believe under different circumstances that event would be what I n

"Al Reid" wrote:
"mabond" <ma****@discussions.microsoft.comwrote in message news:7A**********************************@microsof t.com...
Hi

Can't believe I've not been able to find the answer to this in the on-line
help.

I have a CheckedListBox which, via a timer control, is populated with the
names of files in a network folder. The "check mark" for each item in the
control is determined by the boolean value of a custom property field of the
file. That value is found using microsoft's dsofile.dll class.

That's the background. What's the problem?....there doesn't seem to be any
"checked change" event for the CheckedListBox control. If my user changes the
check mark on one of the items in the CheckedListBox I want to trigger a
procedure to change the value of the file's custom property field

Changing the value is the easy bit, its all written and waiting to
go.....but I can't find a way to trigger the procedure when the check is
changed

Am I missing something ?

Any help would be appreciated

Thanks

Michael Bond
>
Did you try the ItemCheck event?
"Occurs when the checked state of an item changes"
>
--
Al Reid
>
>
>
Jul 6 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.