Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default UserForm events

I have a form and a class that uses the form. I want to trap events for
a ListBox within the class. I have a MSForms.ListBox variable in the
class, which I set to be the listbox in the form. However, there are
fewer events that I can trap in the class than I could in the form
(there are fewer entries in the combobox containing the list of possible
events). Why? Is there anyway to change this?

In particular, the AfterUpdate, Enter, Exit and maybe some other events
are missing. The same thing happens with other controls, as well. Any
help would be appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default UserForm events

those events belong to the control object - the container on the form that
holds the listbox. To the best of my knowledge, you can't manage those
events from a class.

--
Regards,
Tom Ogilvy


"R Avery" wrote in message
...
I have a form and a class that uses the form. I want to trap events for
a ListBox within the class. I have a MSForms.ListBox variable in the
class, which I set to be the listbox in the form. However, there are
fewer events that I can trap in the class than I could in the form
(there are fewer entries in the combobox containing the list of possible
events). Why? Is there anyway to change this?

In particular, the AfterUpdate, Enter, Exit and maybe some other events
are missing. The same thing happens with other controls, as well. Any
help would be appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default UserForm events

Hi

As far as I know, no. It's an annoying limitation. A workaround might be to
call a class' public sub from the control's own event, lik, in the userform

Private Sub ListBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call MyObject.EvaluateMe
End Sub

HTH. Best wishes Harald

"R Avery" skrev i melding
...
I have a form and a class that uses the form. I want to trap events for
a ListBox within the class. I have a MSForms.ListBox variable in the
class, which I set to be the listbox in the form. However, there are
fewer events that I can trap in the class than I could in the form
(there are fewer entries in the combobox containing the list of possible
events). Why? Is there anyway to change this?

In particular, the AfterUpdate, Enter, Exit and maybe some other events
are missing. The same thing happens with other controls, as well. Any
help would be appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default UserForm events

Actually, not only cannot I trap those events, but when I set the
class's ListBox (or any other control that I have tested), it does not
seem to have all of the proper methods according to intellisense. For
example, it is missing the Top and Left properties. However, I can set
these despite not being in Intellisense.

Why? Is there anyway to fix this?


Tom Ogilvy wrote:

those events belong to the control object - the container on the form that
holds the listbox. To the best of my knowledge, you can't manage those
events from a class.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default UserForm events

Again, if you look at the object browser, you will probably see those are
properties of the control object and not of the listbox itself - such as
rowsource as an example. When the listbox is on the worksheet, the property
is ListFillRange and is provided by the OLEObject. If you can set them,
then I don't see anything to fix. For the events, I am not aware of a fix.

--
Regards,
Tom Ogilvy


"R Avery" wrote in message
...
Actually, not only cannot I trap those events, but when I set the
class's ListBox (or any other control that I have tested), it does not
seem to have all of the proper methods according to intellisense. For
example, it is missing the Top and Left properties. However, I can set
these despite not being in Intellisense.

Why? Is there anyway to fix this?


Tom Ogilvy wrote:

those events belong to the control object - the container on the form

that
holds the listbox. To the best of my knowledge, you can't manage those
events from a class.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default UserForm events

Ok. I understand. Thanks a lot. I love this newsgroup.



Tom Ogilvy wrote:

Again, if you look at the object browser, you will probably see those are
properties of the control object and not of the listbox itself - such as
rowsource as an example. When the listbox is on the worksheet, the property
is ListFillRange and is provided by the OLEObject. If you can set them,
then I don't see anything to fix. For the events, I am not aware of a fix.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
events? [email protected] Excel Discussion (Misc queries) 1 September 14th 05 03:26 PM
unload userform from within one of that form's beforeupdate events? Andrew H[_3_] Excel Programming 1 August 10th 04 09:07 AM
IeTimer events not working in modeless Userform? Ed[_18_] Excel Programming 0 August 3rd 04 04:21 PM
UserForm Events Nigel[_6_] Excel Programming 1 February 22nd 04 12:19 PM
events Mark[_17_] Excel Programming 1 October 29th 03 12:56 PM


All times are GMT +1. The time now is 03:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"