ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to add textbox/buttons to an UserForm (https://www.excelbanter.com/excel-programming/273779-how-add-textbox-buttons-userform.html)

Terence[_2_]

How to add textbox/buttons to an UserForm
 
Hi,

I am trying to add an UserForm to my Excel macro and it is
for displaying data by some textboxes on it. However, how
can I add the buttons/textboxes on the form? I can't find
the ControlTool box tool bar in the VB Editor....
Can anyone help? Thanks a lot!

Terence

Bob Phillips[_5_]

How to add textbox/buttons to an UserForm
 
Terence,

I think that Patrick thought you wanted to add these controls dynamically
whilst the form was up.

In design mode, there most certainly is a toolbox to add con trols from. In
the VB IDE, goto menu ViewToolbox, and click it. You should so a familiar
controls toolbox pop up, and although it's not drag and drop, you just
click a control to activate it, and then draw it on the form.

--

HTH

Bob Phillips

"Terence" wrote in message
...
Hi Patrick,

Thanks for your help.
Do you mean that there is no "drag & drop" of controls
into the form?

Terence
-----Original Message-----
an example:

Dim ctrl As Control
Set ctrl = _
Me.Controls.Add("Forms.CheckBox.1")
With ctrl
.Top = ctrl.Height
.Left = 25
.Caption = "CheckBox " & colCheckBoxes.Count
End With

read up on 'controls'

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Hi,

I am trying to add an UserForm to my Excel macro and it

is
for displaying data by some textboxes on it. However,

how
can I add the buttons/textboxes on the form? I can't

find
the ControlTool box tool bar in the VB Editor....
Can anyone help? Thanks a lot!

Terence
.

.




terence

How to add textbox/buttons to an UserForm
 
Thanks a lot!

-----Original Message-----
Terence,

I think that Patrick thought you wanted to add these

controls dynamically
whilst the form was up.

In design mode, there most certainly is a toolbox to add

con trols from. In
the VB IDE, goto menu ViewToolbox, and click it. You

should so a familiar
controls toolbox pop up, and although it's not drag and

drop, you just
click a control to activate it, and then draw it on the

form.

--

HTH

Bob Phillips

"Terence" wrote in message
...
Hi Patrick,

Thanks for your help.
Do you mean that there is no "drag & drop" of controls
into the form?

Terence
-----Original Message-----
an example:

Dim ctrl As Control
Set ctrl = _
Me.Controls.Add("Forms.CheckBox.1")
With ctrl
.Top = ctrl.Height
.Left = 25
.Caption = "CheckBox " &

colCheckBoxes.Count
End With

read up on 'controls'

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Hi,

I am trying to add an UserForm to my Excel macro and

it
is
for displaying data by some textboxes on it. However,
how
can I add the buttons/textboxes on the form? I can't
find
the ControlTool box tool bar in the VB Editor....
Can anyone help? Thanks a lot!

Terence
.

.



.



All times are GMT +1. The time now is 12:21 PM.

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