|
|
|
|
|
|
New to myExercises:
New to myNotes:
|
What is the difference between Debug.Write and Debug.WriteLine?
Debug.WriteLine displays each result in a new line while Debug.Write displays all the results on one line without spaces.
Purpose: Is used to display a message in the Output window while a procedure is being processed by the computer. If the message is a container, the contents thereof will be displayed.
Syntax: Debug.WriteLine(message)
message: can be a literal constant, e.g. "Hello" or "5" can be the name of a variable, object or constant, e.g sngSales, objTextBox, conTax
Example:
To display the contents of the variable sngNumber in the Output window Debug.WriteLine(sngNumber)
Allows you to shift the focus to a specified control (make an inactive control active) while the program is running.
Syntax:
Is used to select (highlight) all the text contained in a textbox. Text will only be selected if the textbox has the focus, so use it in conjunction with the Focus method for best results.
Syntax:
Is used to change the location and/or size of a control while the program is running.
Syntax:
Arguments list:
Tips:
Examples:
Notice the effect of using two different arguments for the same statement:
Me.FruitPictureBox.SetBounds(35, 60, 0, 0, BoundsSpecified.Location) -- The picturebox is placed 35 pixels from the left edge of the form and 60 pixels from the top edge of the form, but the size remains unchanged
Me.FruitPictureBox.SetBounds(35, 60, 0, 0, BoundsSpecified.All) -- The picturebox is placed 35 pixels from the left edge of the form and 60 pixels from the top edge of the form. The width and height is adjusted to zero pixels
Using a numerical variable in the SetBounds method:
The counter (intCount) in the For...Next loop controls the value of the x argument (x refers to left) in the SetBounds method. The counter increases with every loop which results in the picturebox's x argument being increased accordingly - the visible effect will be that the picturebox moves 5 pixels away from the left edge of the form with every loop.
Dim intCount As Integer For intCount = 0 To 275 Step 5 Me.FruitPictureBox.SetBounds(intCount, 0, 0, 0, BoundsSpecified.X) Next intX
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
All content on this site is free for private use only | Contributions are encouraged | Thank you to Netfirms for the free hosting | If copyright content is published here or links to certain content violates some right/law, contact the Webmaster to have it removed immediately.
Site launched: October 2005 | Updated: July 20, 2006 | Link exchange | Site map | Contact us |