Visual Basic 2008 For Dummies

Visual Basic is a much-used programming language, and Visual Basic 2008 makes using it easier than ever. The My object helps you look through the layers to see the whole structure. And, you get access to keyboard shortcuts and can customize options to suit yourself.






>


>


Using the My Object in Visual Basic 2008


The most impressive single language feature in Visual Basic 2008 is the My object. The My object is an object that exposes commonly used .NET technology through an easy-to-understand hierarchy. In short, it is a set of shortcuts into the .NET Framework.


The following table highlights the core classes and common functionality of the My object:


























































My Object Class NameWhat It DoesCool Functionality
My.ApplicationReturns information about and services provided by the current
running application.
The NetworkAvailabilityChanged event is fired when the
computer running the application connects to or disconnects from
the network.
My.ComputerProvides access to resources, devices, and data related to the
computer running the application currently.
Look at My.Computer.Clipboard for methods like
GetText(), which reads from the Windows Clipboard.
My.FormsProvides everything you need to know about all of the forms in
the current project.
My.Forms allows you to use Visual Basic 6–like
functionality built into Windows Forms.
My.LogGrants access to the ASP.NET application log listeners, which
can handle log entries in a myriad of ways.
Look at the <listeners> section of the
Web.Config file, where you can determine where the Log class
is writing to.
My.RequestProvides access to the current Web request for ASP.NET
applications.
Use My.Request to see ASP classic-type access to the
Request, such as My.Request.Headers (the HTTP Web
header collection).
My.ResourcesExposes global application resources.Change the form icon (to show a change in status, for example)
with My.Resources.Form1Icon.
My.ResponseGrants access to the current Web response for ASP.NET
projects.
Use My.Response to see ASP classic-type access to the
Response, like My.Response.Write.
My.SettingsGives the ability to store and retrieve the application-level
settings for the current program.
Change application-level settings at runtime (finally). Set up
the settings in the Application Project Designer, and then use
My.Settings.SettingName to change it at runtime.
My.UserProvides security context information for the user logged into
the computer using the application.
Personalize your application with the current user’s
name. Check out My.User.Name.
My.ServicesProvides access to the Web services referenced by the
application.
After you have referenced a Web Service, you can call it with
My.Services.ServiceName.




>



>


>


Keyboard Shortcut Keys for Visual Studio in Visual Basic 2008


A ton of shortcut key combinations are built into the Visual Studio feature of Visual Basic 2008, and you can feel free to use them all. You can also make your own keyboard shortcuts in the Options dialog box by choosing Tools→Options and then clicking Keyboard in the tree view on the left. The following table includes some useful shortcuts, may of which work in any Windows application.











































Visual Studio ElementKeyboard ShortcutWhat Happens When You Use the Shortcut
BuildCtrl+Shift+BThe most handy keyboard shortcut in the entire system, this key
combination compiles your solution.
Full ScreenShift+Alt+EnterWhen you are mostly writing code, it is sometimes handy to fill
the entire screen with the code window.
Close applicationAlt+F4Closes the Visual Studio window. (Works for other applications,
too.)
Close documentCtrl+F6Closes the active application document.
Shortcut menuShift+F10Displays the context-sensitive shortcut menu for whatever is
actively selected (such as the Toolbox or Solution Explorer).
Show Properties windowF4Shows the Properties window — arguably one of the most
common windows you need on a moment’s notice.
Toggle tree focus selectionCtrl+SpacebarToggles a selection for the current focus in tree view.




>



>


>


How to Modify the Options Panels in Visual Basic 2008


You can change almost everything about how you use your programming environment from the Options dialog box in Visual Basic 2008. Take the time to familiarize yourself with this handy dialog box and set up your environment for just the way you like to work.


You get to the Options dialog box by choosing Tools→Options from the main menu. You navigate through the various options screens using the tree view on the left side. To show the total of all of the options, check the Show All Settings check box in the lower-left corner of the Options dialog box. The following table gives you a rundown of the amazing amount of stuff you can alter from this one spot.































































IDE ElementWhere You Set ItWhat It Does for You
Tab sizesText Editor – All Languages – TabsLets you specify the tab sizes for Visual Basic code (or any
other language in Visual Studio, for that matter)
SQL Parameter PrefixesDatabase Tools – Query and View DesignersWhen Visual Studio creates SQL parameters, it will add these
prefixes to the names to meet with your standards.
Comment TokensEnvironment – Task ListThese are the phrases that you can begin comments with in order
to add them to the task list.
Opening viewHTML Designer – GeneralWhen you open an ASPX or HTML file, you have a choice to see it
in the Designer View or the Code View.
Source control loginSource Control – Plug-in SettingsIf you are using Source Safe, you can set your username
here.
AutoRecover timingEnvironment – AutoRecoverIn case of blackout, you can set how often Visual Studio saves
your code in an AutoRecover file, just like what happens in
Office.
Viewing HelpEnvironment – Help – GeneralIn Visual Studio, the Help is actually a totally separate
application. You can view it inside Visual Studio by changing a
setting here.
VB code optionsProjects and Solutions –VB DefaultsIf you like your code compiled with Option Explicit or Option
Strict by default, you can set it here.
HTML FormattingText Editor – HTML – FormatsIf you don’t like the editor adding the close tag to HTML
elements for you, you can turn that off here.
Startup ActionsEnvironment – StartupYou can set the last project you worked on to load
automatically here, as well as customize the RSS feed that the
Start page uses.
Online HelpEnvironment – Help – OnlineWhen you aren’t connected to the Internet, you may not
want the Help software to check online. You can change the option
here.




>






>
dummies


Source:http://www.dummies.com/how-to/content/visual-basic-2008-for-dummies-cheat-sheet.html

No comments:

Post a Comment