0

I do not know if there is a limit in the form, the picture boxes are not in the position I set and I cannot select 595 Lines or above with the mouse in the list box. Please watch the video for details. Video = https://youtu.be/rEyuVu66G8Q

 For i As Integer = 1 To FOTOLAR.Items.Count

        Dim a As Integer
        Dim newPictureBox As New PictureBox()
        newPictureBox.Name = "PictureBox" & i
        newPictureBox.Location = New Point(1, 4 + a)
        ListBox2.Items.Add(4 + a)
        newPictureBox.Size = New Size(55, 55)
        newPictureBox.BorderStyle = BorderStyle.FixedSingle
        newPictureBox.SizeMode = PictureBoxSizeMode.CenterImage
        newPictureBox.BackColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255))
        Me.Controls.Add(newPictureBox)
        a = a + 55

        Dim stra As String = FOTOLAR.Items.Item(i - 1)
        Dim fs As System.IO.FileStream
        fs = New System.IO.FileStream(stra, IO.FileMode.Open, IO.FileAccess.Read)
        newPictureBox.Image = System.Drawing.Image.FromStream(fs)
        fs.Close()
        AddHandler newPictureBox.MouseDoubleClick, AddressOf picd_Click
        AddHandler newPictureBox.MouseClick, AddressOf pic_Click
        AddHandler newPictureBox.MouseDown, AddressOf picmd_Click
        AddHandler newPictureBox.MouseMove, AddressOf picmm_Click
    Next

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
    '  Button6.Location = New Point(1, 33609)
    For Each Pbox As PictureBox In Me.Controls.OfType(Of PictureBox)()
        If Pbox.Name = "PictureBox612" Then
            ISIMLER.SelectedIndex = 612
            Pbox.BringToFront()
            MsgBox("wrong: " & Pbox.Location.Y) '32767
            MsgBox("Correct: 33609")
            If Pbox.Location.Y = 32767 Then
                Pbox.Location = New Point(1, 33609)
            End If

        End If

    Next

End Sub
KARA
  • 1
  • 2
  • No one looks for videos here :( Otherwise it is Windows limitation, see https://stackoverflow.com/questions/8064678/windows-forms-panel-32767-size-limit and similar topics. – Arvo May 12 '21 at 07:42
  • What is `FOTOLAR`. I am having trouble figuring out what kind of object has `.Items.Item(i - 1)` property/method. – Mary May 13 '21 at 07:01
  • Move `Dim a As Integer` outside the for loop. – Mary May 13 '21 at 07:03
  • Are the small images to the left of the list in the video the picture boxes? There appear to be repeat images. – Mary May 13 '21 at 07:17
  • @Mary `FOTOLAR.Items.Item (i - 1)` FOTOLAR I used it to get the text value of the item with index number 0 in the listbox. This number (i) increases with each iteration and I get the new text value on the next line. `Dim a As Integer` in the loop. `a = a + 55` – KARA May 15 '21 at 18:20
  • `Are the small images to the left of the list in the video the picture boxes? There appear to be repeat images.` Yes, Each file has its own icon in the pictureboxes. – KARA May 15 '21 at 18:24
  • Okay, but what is FOTOLAR when it was declared? Is it a control? If so, what kind? Is it one of your classes? What is it? – Mary May 15 '21 at 23:40
  • FOTOLAR are a Listbox control and her name is FOTOLAR. – KARA May 16 '21 at 00:57

0 Answers0