|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CheckedListbox - change check eventCan'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
Show quote
Hide quote
"mabond" <mab***@discussions.microsoft.com> wrote in message news:7A4CE4D2-14C6-437E-BE1A-BEECBD58DDC3@microsoft.com... Did you try the ItemCheck 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 "Occurs when the checked state of an item changes" -- Al Reid 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 Show quoteHide quote "Al Reid" wrote: > "mabond" <mab***@discussions.microsoft.com> wrote in message news:7A4CE4D2-14C6-437E-BE1A-BEECBD58DDC3@microsoft.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 > > > 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. Show quoteHide quote "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" <mab***@discussions.microsoft.com> wrote in message news:7A4CE4D2-14C6-437E-BE1A-BEECBD58DDC3@microsoft.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 > > > > > > 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 Show quoteHide quote "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" <mab***@discussions.microsoft.com> wrote in message news:7A4CE4D2-14C6-437E-BE1A-BEECBD58DDC3@microsoft.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 > > > > > > > > > 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 Show quoteHide quote "mabond" <mab***@discussions.microsoft.com> wrote in message news:081A4F44-613A-4C56-9206-D0558B0E8600@microsoft.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" <mab***@discussions.microsoft.com> wrote in message >> news:7A4CE4D2-14C6-437E-BE1A-BEECBD58DDC3@microsoft.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 >> >> >>
Valid file name
timer control TreeView control checked based on if records exist CreateInstance and late binding what is best practice to populate large combobox? Validating Data Using a Error Provider EM_CHARFROMPOS with RichTextBox DBNull problem Q: Deleting a table with constraints Data binding to an object |
|||||||||||||||||||||||