Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Daisy Brown   on Jan 06 In MS Office Category.

  
Question Answered By: Gilbert Moore   on Jan 06

Try :

Private Sub UserForm_Initialize()
Dim lbl As Control 'dim as Control or Forms.Label
Set MyForm = UserForm1
Set lbl = MyForm.Controls.Add("Forms.Label.1", "myLabel", True)
With lbl
.Top = 10
.Left = 10
.Height = 15
.Width = 25 'made it wider
.Caption = "TEST" 'write something
End With
End Sub

Share: 

 
 
Didn't find what you were looking for? Find more on Creating Controls at Runtime on UserForm Or get search suggestion and latest updates.


Tagged: