Type of textbox on userform

  • Thread starter Thread starter Lieven Mettepenningen
  • Start date Start date
L

Lieven Mettepenningen

Hello,

could someone tell me what the type is of a textbox you put on a userform
with the vba toolbox? I want to create such a textbox at runtime via a class
module. I thought it was from type MSForms.TextBox, but this type hasn't got
the event handler LostFocus, which I really need for my application and
which all the regular textboxes on a userform do have. Could someone help me
please?

Thx,

Lieven
 
Hi,

It is indeed an msForms.Textbox.

But not all events you have in the userform's code module
itself are available in a class module.

Regards,

Jan Karel Pieterse
Excel TA/MVP
 
Just adding to Jan's good advice:

Lostfocus is not an event any textboxes have on a userform. It is an event
provided by the OLEObject on a worksheet and is only available to msforms
textboxes when they are placed on a worksheet. Events provided by the
containers OLEObject and Control, are not available in With Events/class
modules in my experience.
 
Back
Top