You could try to write a function that first chops your long string into multiple lines by inserting vbCrLf or vbNewLine where appropiate and then draw the string including the line breaks.
So you want to count records with a same value in column 2 and a different value in column 1 if I understand correctly. You could simply use the DISTINCT keyword in your SQL query (google it up, it's easy to find an example).
You might want to try to use a StreamReader. The StreamReader has a method ReadLine, which will get the next line into a System.String.
If you use a text file, then you have to go line by line though. You can't search and jump to a specific line.
That smells like not using an instance of your class. If you add the controls programmatically, make sure you create an instance of them.
E.g.:
Private myControl As New myCustomControl
myForm.Controls.Add(myControl)
I think you need to include a data-adapter, like this:
Dim SQL As String = "UPDATE [Categories] SET [Checked] = 1 WHERE [ID] = 2;"
Dim Cnn As New OleDbConnection("Your connectionstring")
Dim DA As New OleDbDataAdapter
Dim CMD As New OleDbCommand(SQL, Cnn)
Cnn.Open()...
I think it's a good habit to release variable memory in every function or sub to ensure optimal memory use. You can either use the Dispose member or set it to nothing. I can't think of a way to do it globally from the top of my head, unless you declare everything globally:
Class MyClass...
Just use the fully qualified path to call the other application, for example:
Shell("D:\MyFolder\MyApp.exe", AppWinStyle.NormalFocus)
You may want to look up the ChDrive and ChDir functions in your help files.
Well, assuming you use the listview in Details view, the size is in the second column and you want to update all items at once:
Public Sub UpdateSize()
Dim itemX As ListViewItem
Dim stringNewSize As String
For Each itemX In ListView1
stringNewSize = getNewSize(itemX.Text)...
You can select the last item item in listbox like this:
ListBox1.SelectedItem = ListBox1.Items(ListBox1.Items.Count - 1)
Just make sure there's at least one item in the listbox (ListBox1.Items.Count > 0).
Also note that the first item in a listbox is referred to as item(0), so you need to...
You should really consider using structures. The data in the structure can be accessed as if it were a property and all would be much easier. Put the declaration and initialization of the structure in a module, make it public and you can access it from anywhere in the project. Try and look it up...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.