Hints: Program 5
Hints:
Program 5
- P.S. do not
make the two lists a
control
array!
- Center the form on the desktop by using the code
statements shown in the chapter.
- Use the Drag1pg.ico as DragIcon for the top
text
box. The icon is located using the following path (C:\Program Files\Microsoft
Visual Studio\Common\Graphics\Icons\Dragdrop)
(Set the
Icon
property of the form
to Drag1pg.ico
at design time.
Use a code statement
in the Form_Load event to assign the DragIcon
property of the top text
box to the
Icon
property of the form.)
- Use an If statement in the
DragDrop event of the
team list boxes to prevent a blank name being dragged
onto a list. Use a
MsgBox function
to inform the user to enter a player name in the text
box before dragging it onto a team.
- Use the ToolTipText
property on the top text
box to give the users directions
on how to drag and drop the names onto the two volleyball
lists. The text for ToolTip is "Drag and Drop New Player Text to
Team1 or Team2".
- Important: Remember to name
the control being dragged Source in your code!
Code for the Additem method
for list boxes:
- General Format:
listobject.AddItem
data item to add (must be a String)
- Example adding constant:
lstFoodSelections.Additem "Apple Pie"
- Example adding
variable:
lstCarNames.Additem txtNewCar.Text
- For more information type
AddItem into the Help
menu in Visual Basic
|
Assignments |
Extra Credit |
Outputs |
Requirements |