Hello everyone
I'm fairly new to Visual Basic, so this question might be very "dumb" .
For an assignment I have to use a class that contains a number of properties, among other things, to remember the maximum length of the various data (maximum length of the name, maximum length of the country, etc.) for the purpose of aligning the data.
I've tried a few things but I'm not sure how to do about this.
Can you guide me in the right direction?
Form 1:
Code:Dim NameLength As New LayoutClass If Persons Is Nothing Then TextBox1.Text = "no person was found" Else Dim queryData = From Person In Persons.Descendants("Person") Where (Person.Attribute("Name")).Value <> "" Select Naam = Person.Attribute("Name").Value, Country= Person.Attribute("Country").Value Order By (Name) TextBox1.Text = " " TextBox1.Text = "The persons are: " & vbCrLf & NameLength.PersonNameLength
LayoutClass
Code:Public Class LayoutClass Public Property NameLength() As Short Public Property CountryLength() As Short Public Function PersonNameLength() As Short Dim PersonLength As Short If PersonLength > NameLength Then PersonNameLength = PersonLength End If Return PersonNameLength End Function End Class
Thanks for the effort!




Reply With Quote
