SHARE
TWEET

Untitled

a guest Jun 19th, 2017 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   Private Sub Textboxen_links(ByVal anzahl As Integer)
  2.         Dim i As Integer
  3.         Dim panel1 As New Panel
  4.  
  5.         panel1.Top = 36
  6.         panel1.Left = 140
  7.         panel1.Width = 320
  8.         panel1.Height = 220
  9.         GroupBoxLinks.Controls.Add(panel1)
  10.  
  11.         For i = 0 To anzahl
  12.             tbl = New TextBox()
  13.             tbl.Width = 310
  14.             tbl.Text = a(1, 3, i)
  15.             tbl.BorderStyle = BorderStyle.FixedSingle
  16.             tbl.Name = "Box_links" & i
  17.             tbl.Left = 5
  18.             tbl.Top = 5 + i * 26
  19.             tbl.ReadOnly = True
  20.             panel1.Controls.Add(tbl)
  21.             '</ textbox >
  22.             '< anzeigen >
  23.             panel1.BringToFront()
  24.             BringToFront()
  25.             '</ anzeigen >
  26.         Next
  27.  
  28.        
  29.     End Sub
  30.  
  31.     Private Sub Kopier_Buttons(ByVal anzahl As Integer)
  32.         Dim i As Integer
  33.  
  34.         Dim panel3 As New Panel
  35.         panel3.Top = 229
  36.         panel3.Left = 491
  37.         panel3.Width = 31
  38.         panel3.Height = 250
  39.  
  40.         Me.Controls.Add(panel3)
  41.  
  42.         For i = 0 To anzahl
  43.             bu = New Button()
  44.             bu.Width = 24
  45.             bu.Text = "->" & i
  46.             bu.Name = "Button" & i
  47.             bu.Left = 1
  48.             bu.Top = 24 + i * 26
  49.             panel3.Controls.Add(bu)
  50.             AddHandler bu.Click, AddressOf bu_click
  51.             '</ textbox >
  52.             '< anzeigen >
  53.             panel3.BringToFront()
  54.             BringToFront()
  55.             '</ anzeigen >
  56.         Next
  57.  
  58.     End Sub
  59.  
  60.     Private Sub bu_click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  61.         Dim i As Integer
  62.  
  63.         If TypeOf (sender) Is Button Then
  64.             Dim btn As Button = DirectCast(sender, Button)
  65.             MsgBox(btn.Name) 'Button + i
  66.         Dim number As Int = Convert.ToInt32(btn.Name.Replace("Button", "")) 'Entferne "Button" und wandel in Int
  67.         KopiereTextboxInhalt(number)
  68.         End If
  69.  
  70.     End Sub
  71.  
  72.     Private Sub KopiereTextboxInhalt(ByVal i As Integer)
  73.  
  74.         Dim panelFound As Panel
  75.     Dim tblFound As Textbox
  76.         For Each ctl As Control In GroupBoxLinks.Controls
  77.         If ctl Is Panel Then
  78.             panelFound = ctl
  79.  
  80.             For Each tbl As Control in panelFound.Controls
  81.                 If tbl Is Textbox Then
  82.                     tblFound = tbl
  83.                     MsgBox(tblFound.Text)
  84.                     Exit For
  85.                 End If 
  86.             Next tbl
  87.             Exit For
  88.         End If
  89.     Next ctl
  90.    
  91.     End Sub
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top