Click here to Skip to main content
15,905,322 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Error handling in TAPI3.0 by vb.net Pin
Paul Conrad9-Dec-07 8:58
professionalPaul Conrad9-Dec-07 8:58 
Generalfra tab Pin
Meenge7-Dec-07 18:13
Meenge7-Dec-07 18:13 
GeneralRe: fra tab Pin
Ray Cassick7-Dec-07 20:16
Ray Cassick7-Dec-07 20:16 
GeneralRe: fra tab Pin
Meenge7-Dec-07 23:19
Meenge7-Dec-07 23:19 
GeneralRe: fra tab Pin
Christian Graus7-Dec-07 23:46
protectorChristian Graus7-Dec-07 23:46 
GeneralRe: fra tab Pin
Ray Cassick8-Dec-07 7:01
Ray Cassick8-Dec-07 7:01 
GeneralFinding Available DB2 Servers Pin
Bob Bonser7-Dec-07 14:25
Bob Bonser7-Dec-07 14:25 
Generaladding multiple textboxes at runtime Pin
craigmg787-Dec-07 10:32
craigmg787-Dec-07 10:32 
I have found alot online about how to add a control at runtime. Unfortunately, I haven't yet found anything that explains how to add multiple controls at once from one event.

I will post what I tried to use to add three textboxes. When I run it, only the third textbox is visible and I'm not entirely sure if the first two were created. (I'm thinking that they were created but replaced by the latest new textbox.) Anyway below is my code. Thanks to anyone who can see what I am doing wrong here:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim NewTB As New TextBox
        Dim TBName As String
        Dim TBindex As Integer = 1

        For TBindex = 1 To 3
           
            TBName = "Textbox" & TBindex
            Me.Controls.Add(NewTB)
            NewTB.Name = TBName
            NewTB.Enabled = True
            NewTB.Visible = True
            NewTB.Height = 20
            NewTB.Width = 100
            NewTB.Top = 130 + ((TBindex - 1) * 25)
            NewTB.Left = 20

        Next TBindex

End Sub


"That rug really tied the room together."

GeneralRe: adding multiple textboxes at runtime Pin
Christian Graus7-Dec-07 10:51
protectorChristian Graus7-Dec-07 10:51 
GeneralRe: adding multiple textboxes at runtime Pin
craigmg787-Dec-07 10:57
craigmg787-Dec-07 10:57 
GeneralRe: adding multiple textboxes at runtime Pin
nlarson117-Dec-07 10:52
nlarson117-Dec-07 10:52 
QuestionWhat is the best way to write the same VBA code for multiple Excel workbooks? [modified] Pin
redjoy7-Dec-07 9:19
redjoy7-Dec-07 9:19 
GeneralRe: What is the best way to write the same VBA code for multiple Excel workbooks? Pin
Dave Kreskowiak8-Dec-07 17:04
mveDave Kreskowiak8-Dec-07 17:04 
GeneralRe: What is the best way to write the same VBA code for multiple Excel workbooks? [modified] Pin
redjoy9-Dec-07 10:26
redjoy9-Dec-07 10:26 
GeneralRe: What is the best way to write the same VBA code for multiple Excel workbooks? Pin
Dave Kreskowiak10-Dec-07 2:02
mveDave Kreskowiak10-Dec-07 2:02 
GeneralRe: What is the best way to write the same VBA code for multiple Excel workbooks? Pin
hwahlberg10-Feb-08 10:24
hwahlberg10-Feb-08 10:24 
GeneralCreate log file Pin
nishkarsh_k7-Dec-07 6:38
nishkarsh_k7-Dec-07 6:38 
GeneralRe: Create log file Pin
nlarson117-Dec-07 8:33
nlarson117-Dec-07 8:33 
GeneralRe: Create log file Pin
Mark Churchill7-Dec-07 14:44
Mark Churchill7-Dec-07 14:44 
GeneralSigning a User Control Pin
Andy Dale7-Dec-07 3:39
Andy Dale7-Dec-07 3:39 
GeneralPassword Problem Pin
Dave McCool7-Dec-07 2:21
Dave McCool7-Dec-07 2:21 
GeneralRe: Password Problem Pin
Christian Graus7-Dec-07 10:53
protectorChristian Graus7-Dec-07 10:53 
GeneralRe: Password Problem Pin
Dave McCool8-Dec-07 1:37
Dave McCool8-Dec-07 1:37 
GeneralEnding a VB Program Pin
Dreamer20077-Dec-07 1:11
Dreamer20077-Dec-07 1:11 
GeneralRe: Ending a VB Program Pin
CPallini7-Dec-07 2:19
mveCPallini7-Dec-07 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.