Append a String to a Text Box
Use this code to cause a TextBox control to automatically scroll down as you concatenate new text: ””Select the end of the text MyTextBox.SelStart = Len(MyTextBox.Text)””Put the new text thereMyTextBox.SelText
Use this code to cause a TextBox control to automatically scroll down as you concatenate new text: ””Select the end of the text MyTextBox.SelStart = Len(MyTextBox.Text)””Put the new text thereMyTextBox.SelText
Use an ampersand (&) instead of a plus sign (+) when concatenatingstrings. Depending on the data type of the operands, using the plus signmay result in an addition.
Don’t use any objects in the Visual Basic object library as parametersor return values for exposed properties or methods in public classes. Theseobjects are not intended to be used from
Instead of declaring an object As Object, use the specific object type, such as CTask. This improves performance by minimizing the OLE lookup requirements.
Place one label on your form, tailor its properties (such as left-alignand autosize), and copy and paste it to create the rest of your labels.
Use With…End With to minimize the number of repeated OLE lookups.This has the added advantage of not requiring the temporary substitutionobject.
VB developers that program with C language might be confused by a feature in the language. Consider thiscode: Dim x As IntegerDim y As IntegerDim z As Integer x =
Start the in-process OLE server using a Sub Main procedure. Includeall server initialization code in the Sub Main procedure. Don’t show formsfrom the Sub Main procedure and don’t use the
Do set all object variables to nothing before ending the application.When the End statement is executed in the OLE client application, the OLEserver is shut down and the Terminate events