Execute from another form

  • Thread starter Thread starter GodspeedSupreme
  • Start date Start date
G

GodspeedSupreme

Guest
Hello everyone.. I need help in executing a code..

this code is in form1.

Public Sub Panel1_Clicked(ByVal sender As System.Object, ByVal e As System.EventArgs)
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 = gettxt
p.Parent.Controls.Add(newPanel)
panels.Add(newPanel)
p.Top = newPanel.Bottom + 6
End Sub


And I need to execute the code Form1.Panel1_Clicked from form2 by clicking a button.


Thank you in advance. :)

Continue reading...
 

Similar threads

G
Replies
0
Views
57
GodspeedSupreme
G
G
Replies
0
Views
54
GodspeedSupreme
G
Back
Top