ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Type of textbox on userform (https://www.excelbanter.com/excel-programming/279591-type-textbox-userform.html)

Lieven Mettepenningen[_2_]

Type of textbox on userform
 
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



Jan Karel Pieterse

Type of textbox on userform
 
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

-----Original Message-----
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


.


Tom Ogilvy

Type of textbox on userform
 
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.

--
Regards,
Tom Ogilvy

"Jan Karel Pieterse" wrote in message
...
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

-----Original Message-----
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


.





All times are GMT +1. The time now is 06:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com