我想问为什么在运行时添加新文本框时将.BorderStyle
设置为fmBorderStyleNone
不起作用?我想要一个没有轮廓的文本框,但是代码运行后仍然有轮廓。
Dim txtB1 As TextBox
Dim i
For i = 0 To 5
Set txtB1 = Frame12.Controls.Add("Forms.TextBox.1")
With txtB1
.Name = "chkDemo" & i
.TextAlign = fmTextAlignCenter
.Height = 20
.Width = 36
.Left = 444
.Top = 10 * i * 2
.BackStyle = fmBackStyleTransparent
.BorderStyle = fmBorderStyleNone '---> this isn't working.
.Font.Name = "Calibre"
.Font.Size = 11
End With
Next i
答案 0 :(得分:2)
您仍然看到轮廓的原因是,默认情况下,插入了带有特殊效果“沉没”的文本框。您还需要更改该属性:
.SpecialEffect = fmSpecialEffectFlat