Example 1 Source Code
Imports System
Module Week0101
Sub Main()
Console.WriteLine("Hello World")
End Sub
End Module
Compile using VBC Week0101.vb
Example 2
![]() |
Some Design Time Properties
Me.grpColor.Controls.AddRange(New
System.Windows.Forms.Control() Me.grpColor.Location
= New
System.Drawing.Point(8, 8) ''hsbRed Me.hsbRed.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right) Me.hsbRed.Location = New System.Drawing.Point(96, 16)Me.hsbRed.Maximum = 264 Me.hsbRed.Name = "hsbRed" Me.hsbRed.Size = New System.Drawing.Size(240, 24) Me.hsbRed.TabIndex = 0 'picPicture Me.picPicture.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right) Me.picPicture.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D Me.picPicture.Location = New System.Drawing.Point(16, 184) Me.picPicture.Name = "picPicture" Me.picPicture.Size = New System.Drawing.Size(136, 120) Me.picPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.picPicture.TabIndex = 1 Me.picPicture.TabStop = False
|
Event Handlers
Private Sub frmMain_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated
Example 3
Private
Sub chkBold_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkBold.CheckedChanged
Private
Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load chkBold.Focus()
chkBold.Show()
Example 4
Assignment
Use the above User Interface as a model for this assignment. The program is to display Team Logos and Team Names in the Picture and Label controls. Then teams are selected using the Radio Buttons. The Label Font is controlled from within the Font Control Group Box. The Size control is a "Numeric Up Down Control" and is located in the VS Tool Box. The Exit Button terminates the program. Make sure you set initial values and edits and limits on what the user can select. Shortcut Keystrokes, Default / Cancel buttons, and Tab Order are important.
You have, I’m sure, noticed the Text Box in the middle of the Picture Box and the Button labeled Answer. The Answer Button is a toggle between the Picture Box and the Text Box. Clicking the button should toggle the display between the Picture Box and The Text Box. These controls should be the same size and occupy the same space. Clicking the button should also toggle the Button Text. Make sure when you change the button text that you don’t loose your shortcut key capability. The Text Box must be locked, so the contents cannot be changed.
The Text Box should contain an answer to this question:
Do the images displayed in the picture box have to be included with the .EXE when the program is complete. If Yes, then where in the project must they be stored. If No, where in the project are they stored?
If you don’t want to use Team Logos, you can use anything you would like. There is a graphics directory shipped with Visual Studio, or you can use images from any number of sources.
EMail the zipped project file to CIS206_Assignments@hotmail.com
Make the subject your name and assignment number (Last Name, First
Name - Week 01)
No exceptions to this format.