タイトル : Re: テキストボックスの幅の調整について 投稿日 : 2011/02/24(Thu) 20:17 投稿者 : 魔界の仮面弁士
> VB6.0で、テキストボックスの幅をそのテキストボックス内のテキストの幅に > したいのですがうまくいきません Option Explicit Private Sub Form_Load() 'Label1.Visible = False Set Label1.Font = Text1.Font Label1.AutoSize = True Label1.BorderStyle = Text1.BorderStyle Label1.Caption = Text1.Text End Sub Private Sub Text1_Change() Label1.Caption = Text1.Text End Sub Private Sub Label1_Change() Dim margin As Single margin = Screen.TwipsPerPixelX * 4 Text1.Width = Label1.Width + margin End Sub |