Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
Dim startY As Integer = 94
Dim buttonSize As New Size(150, 150) ' Button size
Dim horizontalSpacing As Integer = 20 ' Space between buttons horizontally
Dim verticalSpacing As Integer = 20 ' Space between buttons vertically
Dim maxWidth As Integer = Me.ClientSize.Width - 172 ' Max width available for buttons
' Calculate how many buttons can fit horizontally
Dim maxButtonsInRow As Integer = (maxWidth (buttonSize.Width + horizontalSpacing))
Dim currentX As Integer = startX
Dim currentY As Integer = startY
' Loop through items in listBox6 and create buttons
For i As Integer = 0 To ListBox6.Items.Count - 1
' Create a new button for each item
Dim button As New Button()
Dim hello As String = ListBox6.Items(i).ToString()
Dim parts As String() = hello.Split(New String() {"###"}, StringSplitOptions.None)
If parts(1).ToString = "P-PAGE" Then
button.Text = parts(0) & vbCrLf & "Time: " & parts(5) & vbCrLf & "Tag: " & parts(6) & vbCrLf & "Image: " & parts(2)
button.BackColor = Color.DodgerBlue
Else
button.Text = parts(0) & vbCrLf & "Time: " & parts(6) & vbCrLf & "Image: " & parts(3)
button.BackColor = Color.MediumSeaGreen
End If
button.Size = buttonSize ' Set button size
button.ForeColor = Color.White
' Set the font of the button text
button.Font = New Font("Segoe UI", 15.75F, FontStyle.Bold)
' Set the location of the button
button.Location = New Point(currentX, currentY)
button.TextAlign = ContentAlignment.MiddleLeft
' Add the button to the Form
Me.Controls.Add(button)
' Add an event handler for button click
AddHandler button.Click, AddressOf Button_Click
' Store the index of the button for later reference
button.Tag = i ' Save the index of the listBox6 item
' Update currentX and currentY for the next button
currentX += buttonSize.Width + horizontalSpacing ' Move right
' If we've reached the end of the row, reset X and increment Y
If (i + 1) Mod maxButtonsInRow = 0 Then
currentX = startX
currentY += buttonSize.Height + verticalSpacing ' Move down
End If
' Ensure buttons do not go below the taskbar
If currentY + buttonSize.Height > Me.ClientSize.Height - 100 Then
Exit For ' Stop adding if we exceed form height minus taskbar
End If
Next
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team