G
GodspeedSupreme
Guest
Hello Everyone.. I need help in creating a inputbox by using a form and put some ok & cancel button.
My problem is in this code:
Public Sub Panel1_Click(sender As Object, e As EventArgs) Handles Panel1.Click
Dim p As Panel = DirectCast(sender, Panel)
Dim newPanel As New cardPanel
newPanel.Left = 6
newPanel.Top = If(p.Parent.Controls.OfType(Of cardPanel).Count > 0, p.Parent.Controls.OfType(Of cardPanel).Max(Function(cp) cp.Bottom) + 6, 19)
newPanel.Width = p.Width
newPanel.Height = 36
newPanel.BackColor = Color.White
newPanel.percentage = 0
newPanel.Text = InputBox("Enter")
p.Parent.Controls.Add(newPanel)
panels.Add(newPanel)
p.Top = newPanel.Bottom + 6
End Sub
The problem above the code is using the inputbox. when I click cancel.. it would still add a new panel.. thats why I need to manualy create an inputbox using a form.. any idea what efficient way to solve the problem?
Continue reading...
My problem is in this code:
Public Sub Panel1_Click(sender As Object, e As EventArgs) Handles Panel1.Click
Dim p As Panel = DirectCast(sender, Panel)
Dim newPanel As New cardPanel
newPanel.Left = 6
newPanel.Top = If(p.Parent.Controls.OfType(Of cardPanel).Count > 0, p.Parent.Controls.OfType(Of cardPanel).Max(Function(cp) cp.Bottom) + 6, 19)
newPanel.Width = p.Width
newPanel.Height = 36
newPanel.BackColor = Color.White
newPanel.percentage = 0
newPanel.Text = InputBox("Enter")
p.Parent.Controls.Add(newPanel)
panels.Add(newPanel)
p.Top = newPanel.Bottom + 6
End Sub
The problem above the code is using the inputbox. when I click cancel.. it would still add a new panel.. thats why I need to manualy create an inputbox using a form.. any idea what efficient way to solve the problem?
Continue reading...