CheckBox | Forms.CheckBox.1 |
ComboBox | Forms.ComboBox.1 |
CommandButton | Forms.CommandButton.1 |
Frame | Forms.Frame.1 |
Image | Forms.Image.1 |
Label | Forms.Label.1 |
ListBox | Forms.ListBox.1 |
MultiPage | Forms.MultiPage.1 |
OptionButton | Forms.OptionButton.1 |
ScrollBar | Forms.ScrollBar.1 |
SpinButton | Forms.SpinButton.1 |
TabStrip | Forms.TabStrip.1 |
TextBox | Forms.TextBox.1 |
ToggleButton | Forms.ToggleButton.1 |
Private Sub UserForm_AddControl(ByVal Control As MSForms.Control)
'Label1.Caption = "Control was Added."
End Sub
Private Sub Ad_Ctr( _
ID As String, _
ByRef Set_Name, _
Left_Val As Long, _
Top_Val As Long, _
Width_Val As Long, _
Height_Val As Long, _
Optional Control_Name, _
Optional Ctr_Show)
Set Set_Name = Controls.Add(ID, Control_Name, Ctr_Show)
With Set_Name
.Left = Left_Val
.Top = Top_Val
.Width = Width_Val
.Height = Height_Val
.Name = Control_Name
.Caption = .Name
End With
End Sub
Private Sub UserForm_Initialize()
Call Ad_Ctr("Forms.CommandButton.1", Btn, 0, 0, 200, 20, "Btn1")
Btn.Left = 10
End Sub
'만드는 이야기 > VBA' 카테고리의 다른 글
vba) 행마다 각 시트로 링크 생성하기 (0) | 2014.03.11 |
---|---|
vba) 테스트들 모음 (0) | 2014.03.11 |
vba) 현재 시트의 자동 필터 끄기 (0) | 2014.03.07 |
vba)현재 통합문서의 모든시트의 표서식으로 만든 모든표 범위로 변환 (0) | 2014.03.07 |
vba자작) 월마감 집계표 (0) | 2014.03.07 |