For my first handy hint, it is a collection of useful keyboard shortcuts for Visual Studio 2010. They may not be well known by some users.
Ctrl + M + M (ctrl+m then Ctrl + O right after)
Collapses all the regions in the code in the current file.
Alt + E + G (hold Alt, hit E and then G)
Prompts you for a number and then takes you to that line number in the current code file.
Ctrl + M + M
Collapse/expand the current code block.
Alt+Shift+Enter
Full screen code only view. Press again to return to normal or click the highlighted full screen button.
Ctrl + K + C
Comment Block the currently selected code.
Ctrl + K + U
Uncomment Block the currently selected code.
Ctrl + H
Finds and place with text.
Ctrl + W + X
Displays the Toolbox, which contains
controls that can be included or
used with your code.
Handy Hint 2:
My next handy hint is a While Loop password. This assumes the code is on the click event of a button or other control. That control would then trigger the Password procedure:
Module modProcedures
' Variable to store whether the password was guessed
Public access As Boolean
'password procedure
Public Sub Password()
' Variables
Dim password As String
Dim attempts As Integer
While attempts < 3
password = InputBox("Please enter the password.", _
"Attempt: " & attempts + 1, _
MessageBoxButtons.OK, MessageBoxIcon.Information)
Select Case password
Case "P@ssw0rd"
MessageBox.Show("Correct! That is the password.", _
"You may now enter.", _
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
' Sets the access to true
access = True
Exit Sub
Case Else
MessageBox.Show("Incorrect! Try again.", _
"Re-enter the password.", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Select
attempts += 1
End While
' Sets the access to false
access = False
' If the password was not guessed in the allowed goes
MessageBox.Show("You have not managed to guess the password.", _
"No entry.", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
End Module
Using the procedure:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Calls the password procedure
Call Password()
If access Then
MessageBox.Show("Access allowed.")
Else
MessageBox.Show("No access.")
End If
Report:
IT Training Session Report.docx
Presentation:
Operating Systems.ppt
Handy Hint 1:
For my first handy hint, it is a collection of useful keyboard shortcuts for Visual Studio 2010. They may not be well known by some users.
controls that can be included or
used with your code.
My next handy hint is a While Loop password. This assumes the code is on the click event of a button or other control. That control would then trigger the Password procedure:
Module modProcedures
' Variable to store whether the password was guessed
Public access As Boolean
'password procedure
Public Sub Password()
' Variables
Dim password As String
Dim attempts As Integer
While attempts < 3
password = InputBox("Please enter the password.", _
"Attempt: " & attempts + 1, _
MessageBoxButtons.OK, MessageBoxIcon.Information)
Select Case password
Case "P@ssw0rd"
MessageBox.Show("Correct! That is the password.", _
"You may now enter.", _
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
' Sets the access to true
access = True
Exit Sub
Case Else
MessageBox.Show("Incorrect! Try again.", _
"Re-enter the password.", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Select
attempts += 1
End While
' Sets the access to false
access = False
' If the password was not guessed in the allowed goes
MessageBox.Show("You have not managed to guess the password.", _
"No entry.", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
End Module
Using the procedure:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Calls the password procedure
Call Password()
If access Then
MessageBox.Show("Access allowed.")
Else
MessageBox.Show("No access.")
End If
End Sub
End Class