473,326 Members | 2,081 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,326 software developers and data experts.

CheckedListbox - change check event

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
5 6816
"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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Danny | last post by:
Hello I am trying to create a separate listbox and fill it with items based on what is in another field in a database. This field is bound to a field in the underlying database. But the data...
1
by: Bijoy Thulasidharan | last post by:
Hi , Hope you should be able to help us out with the below issue Before subscribing to a delegate like this cell.OnGridCellSelected += new System.EventHandler(_OnGridCellSelected); we...
1
by: Somyos | last post by:
How can I check event clicking the 'X' button in the upper right hand corner of a window. and call function or sub before close web page. I'm using Asp.net on VS.NET Thank.
4
by: mark | last post by:
is it possible to change an elements Z-INDEX value on an onclick event in codebehind ? id like to change the posistion of a datagrid once a button has been pressed cheers mark
1
by: tshad | last post by:
Is there a way to change the onClick event of a LinkButton? At the moment, I am using 2 buttons that I toggle the visibility on and off. I would like to use just one button, if possible and just...
10
by: jerry.ranch | last post by:
I have a series of comboboxes on a form that are used to display forms in DS view (theres a qry behind it all). This is working well for me. Some people like to see the data in DS view, some in...
1
by: Huahe | last post by:
Hi, I have an checkedlistbox with a lot of items, so there is a vertical scrollbar in the checkedlistbox. I want to make the checkedlistbox invisible when the mouseleave event goes off. The...
1
by: QuickBooksDev | last post by:
VB.NET 2005 DataGridView Checkbox - Check Event need to know check status I would like to use the DataGridView Checkbox like a normal checkbox. When someone clicks on it I would expect that I...
1
by: =?Utf-8?B?UGF0cmljaw==?= | last post by:
In C# I can check whether an event instance is nothing or not public event SomeEvent SomeClickEvent; if (SomeClickEvent != null) { } But when I do this in VB it returns an error message ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.