Hello,
Is it possible to have Visual Basic Coding to create Combo Boxes, TextBoxes, and Labels on the Fly? I need to have these created only on page one of my form and not have it appear on the other pages. I have created One Template Form to use where I am going from page top page with lines and totals. I want a Combo Box for Month, day, and year to just appear on the First Page Only.
I have created this by researching, but it is not working:
I have code:
Public Class Form2
Private buttonPanel As New Panel
Private WithEvents btnClose As New Button
Private WithEvents btnNext As New Button
Private WithEvents btnPrev As New Button
Private WithEvents btnSave As New Button
Private WithEvents btnCalc As New Button
Private WithEvents TxtBatch As New ComboBox
Private Sub AddButtons(ByVal bPrev As Boolean, ByVal bNext As Boolean)
'places buttons on form
With btnClose
.Text = "Close"
.Location = New Point(25, 0)
.TabStop = True
.TabIndex = 90
.Width = 75
.Height = 23
.Visible = Not (bPrev) ' Visible on last page only, first page could be last page
End With
With btnNext
.Text = "Next >"
.Location = New Point(25, 50)
.TabStop = True
.TabIndex = 91
.Width = 75
.Height = 23
.Visible = bNext ' visible only if more than one page and not the last page
End With
With btnPrev
.Text = "< Prev"
.Location = New Point(25, 25)
.TabStop = True
.TabIndex = 92
.Width = 75
.Height = 23
.Visible = bPrev
End With
With TxtBatch
.Location = New Point(932, 219)
.Size = New Point(66, 20)
.Visible = bNext
End With
I can get it to work with Buttons, but it want work for the Combo Boxes.
Is it possible to have Visual Basic Coding to create Combo Boxes, TextBoxes, and Labels on the Fly? I need to have these created only on page one of my form and not have it appear on the other pages. I have created One Template Form to use where I am going from page top page with lines and totals. I want a Combo Box for Month, day, and year to just appear on the First Page Only.
I have created this by researching, but it is not working:
I have code:
Public Class Form2
Private buttonPanel As New Panel
Private WithEvents btnClose As New Button
Private WithEvents btnNext As New Button
Private WithEvents btnPrev As New Button
Private WithEvents btnSave As New Button
Private WithEvents btnCalc As New Button
Private WithEvents TxtBatch As New ComboBox
Private Sub AddButtons(ByVal bPrev As Boolean, ByVal bNext As Boolean)
'places buttons on form
With btnClose
.Text = "Close"
.Location = New Point(25, 0)
.TabStop = True
.TabIndex = 90
.Width = 75
.Height = 23
.Visible = Not (bPrev) ' Visible on last page only, first page could be last page
End With
With btnNext
.Text = "Next >"
.Location = New Point(25, 50)
.TabStop = True
.TabIndex = 91
.Width = 75
.Height = 23
.Visible = bNext ' visible only if more than one page and not the last page
End With
With btnPrev
.Text = "< Prev"
.Location = New Point(25, 25)
.TabStop = True
.TabIndex = 92
.Width = 75
.Height = 23
.Visible = bPrev
End With
With TxtBatch
.Location = New Point(932, 219)
.Size = New Point(66, 20)
.Visible = bNext
End With
I can get it to work with Buttons, but it want work for the Combo Boxes.