See this code |
| Sujit Patil replied to Dharma K at 03-Jul-08 02:51 |
Private Sub Command1_Click() ctrlName = "DynTxtBx" Set txtObject = Form1.Controls.Add("VB.TextBox", ctrlName) With txtObject .Visible = True .Left = 250 .Width = 4000 .Height = 250 .Top = tValue .Text = "This is a dynamically created TextBox No." & CStr(cIndx) End With End Sub
Or you can use this also
Dim c As Control c = New TextBox() c.Name = "myControl" c.Width=200; c.Height=200; Me.Controls.Add(c)
Try this code.
You can change the size using WIDHT and HIGHT property of textbox like;
textBox.Height=200;
textBox.Widht=200;
Best Luck!!!!!!!!!!!!!!! Sujit.
|
|