سلام
اول اینکه کلاس Library رو در یک کلاس مجزا بسازید و نه در کلاس فرم
Public Class Library
Public Property Capacity() As Integer
Private Property Count as Integer = 5
Public Function Insert() As string
count += 1
If count > Capacity Then
Return "Full"
Else
Return "Insert is done"
End If
End Function
End Class
در مرحله بعد ، طبیعیه وقتی شما در رویداد کلیک باتن یک instance از کلاس می سازید ، شمارنده شما مقدارش با هر کلیک اضافه نمیشه ، بنابراین instance کلاس library باید در سطح فرم باشه و با هرکلیک متد insert فراخوانی بشه صرفا (مثال زیر)
Public Class Form1
Private libraryClass As New Library
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
libraryClass.Capacity = 10
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Label1.Text = libraryClass.Insert()
End Sub
End Class
نیازی به فرستادن پروژه نیست.