Home
Wiley Professional Visual Studio 2008
Contents
1. le 3a My Project z E Form1 vb y iS s E 3 0 L Solutio Eg Class Vi AF Propert Item s Saved EE E 334x263 Figure 1 7 Chapter 1 A Quick Tour 2 Click on the Toolbox tool window which will cause the window to expand followed by the pin icon which will pin the tool window open To add controls to the form select the appropriate items from the Toolbox and drag them onto the form In Figure 1 8 you can see how the Toolbar tool window appears after being pinned and the result of clicking and dragging a button onto the form visual designer Q GettingStarted Microsoft Visual Studio e File Edit View Project Build Debug Data Tools Test Window Help iW Y G6d s4 anaana d Debug gt Any CPU it ASD Oto ak 2 BI PSS at ope 20s 0 te bl St St 5 Gay By decline 2 X Formlyb Design Formi vb Start Page x All Windows Forms a aLe FEAA Common Controls a I Solution GettingStarted ay Form o e ss ee GF GettingStarted utton 3 My Project 2 My Projec E CheckBox E Form1 vb EG CheckedListBox ES ComboBox FA DateTimePicker A Label A LinkLabel EF ListBox 2 MaskedTextBox FE MonthCalendar s l_Notifulean o 0 oH Sig Server Explorer 32 Toolbox sol gce Pro Ready p r Figure 1 8 3 Adda button and textbox to the form so that the layout looks similar to the one shown in F
2. Visual Basic or Visual C Visual Studio uses this information to apply a predefined collection of settings to the development environment that is designed for your development activity You can choose to use a different collection of settings at any time From the Tools menu choose Import and Export Settings and then choose Reset all settings 7 Allow Visual Studio to download and display online RSS content V Migrate my eligible settings from a previous version and apply them in addition to the default settings selected below Choose your default environment settings General Development Settings Description Visual Basic Development Settings Please select one of the collections of settings from Visual C Development Settings the list Visual C Development Settings Web Development Settings Figure 1 2 A tip for Visual Basic NET developers coming from previous versions of Visual Studio is that they should NOT use the Visual Basic Development Settings option This option has been configured for VB6 developers and will only infuriate Visual Basic NET developers as they will be used to different shortcut key mappings We recommend that you use the general development settings as these will use the standard keyboard mappings without being geared toward another development language Chapter 1 A Quick Tour The Visual Studio IDE Depending on which set of environment settings you select when you click the Start Visua
3. remain in its expanded or pinned state you can click the middle icon which looks like a pin The pin will rotate 90 degrees to indicate that the window is now pinned Clicking the third icon the X will close the window If later you want to reopen this or another tool window you can select it from the View menu Some tool windows are not accessible via the View menu for example those having to do with debugging such as threads and watch windows In most cases these windows are available via an alternative menu item in the case of the debugging windows it is the Debug menu The right image in Figure 1 4 shows the context menu that appears when the first icon the down arrow is clicked Each item in this list represents a different way of arranging the tool window In the left image of Figure 1 5 the Solution Explorer is set as dockable whereas in the right image the floating item has been selected The latter option is particularly useful if you have multiple screens as you can move the various tool windows onto the additional screen allowing the editor space to use the maximum screen real estate Selecting the Tabbed Document option will make the tool window into an additional tab in the editor space In Chapter 4 you will learn how to effectively manage the workspace by docking and pinning tool windows Chapter 1 A Quick Tour lt gt Gotting Fie Edit a d Microsoft Visual Stud Vew Project Build Debug Data Tools Tes
4. Part Integrated Development Environment Chapter 1 A Quick Tour Chapter 2 The Solution Explorer Toolbox and Properties Chapter 3 Options and Customizations Chapter 4 Workspace Control Chapter 5 Find amp Replace and Help A Quick Tour Ever since we have been developing software there has been a need for tools to help us write compile and debug our applications Microsoft Visual Studio 2008 is the next iteration in the continual evolution of a best of breed integrated development environment IDE If this is your first time using Visual Studio then you will find this chapter a useful starting point Even if you have worked with a previous version of Visual Studio you may want to quickly skim it This chapter introduces the Visual Studio 2008 user experience and will show you how to work with the various menus toolbars and windows It serves as a quick tour of the IDE and as such it won t go into detail about what settings can be changed or how to go about customizing the layout as these topics will be explored in the following chapters Let s Get Started Each time you launch Visual Studio you will notice the Microsoft Visual Studio 2008 splash screen appear Like a lot of splash screens it provides information about the version of the product and to whom it has been licensed as shown in Figure 1 1 Microsoft e Visual Studio 2008 Professional Edition This product is licensed to 5 Mic
5. bel a Font Microsoft Sa zs istBox ForeColor O ee ee x Ras RiahtTalef No MaskedTextBox Accessibility MonthCalendar 1_Matifidean a a Server Explorer 38 Toolbox ylSol Eg Cla p Pro Ready Tr 13 57 E 100x20 Figure 1 10 Deselect all controls and then double click the button This will not only open the code editor with the code behind file for this form it will also create and wire up an event handler for the Click Event on the button Figure 1 11 shows the code window after we have added a single line to echo the message to the user Chapter 1 A Quick Tour E WD GettingStarted Microsoft Visual Studio ee File Edit View Project Build Debug Data Tools Test Window Help Daa gA h Debug z Any CPU z JIT 8 3B gt S GR Rae TELS SIO DOG a es Qe ult Formi xvb Design Form1 vb start Page EN 3 4gFormi Declarations a m El Public Class Forml S z z Private Sub btnSayHello_Cli ick ByVal sender As System Object ByVal e As System EventArgs Handles btnSayHello Click g 3 MessageBox Show Me txtToSay Text rey x End Subj 3 End Class iss S a 4 m a Q a Item s Saved Ln4 Col 12 Chi2 INS Figure 1 11 6 The last step in the process is to build and execute the application Before doing so place the cursor somewhere on the line containing Messagebox Show and press F9 This will set a breakpoint when you run the application by pressing F5 and then click the Sa
6. cting the Make Same Width icon will align the edges of the two controls as illustrated in Figure 1 10 You will also notice that after you add controls to the form the tab will be updated with an asterisk after the text to indicate that there are unsaved changes to that particular item If you attempt to close this item while changes are pending you will be asked if you want to save the changes When you build the application any unsaved files will automatically be saved as part of the build process One thing to be aware of is that some files such as the solution file are modified when you make changes within Visual Studio 2008 without your being given any indication that they have changed If you try to exit the application or close the solution you will still be prompted to save these changes Q GettingStarted Microsoft Visual Studio l ja a File Edit View Project Build Debug Data Format Tools Test Window Help D a GUase B gt Debug Any CPU RI j b A SILT ot al EREE i oo se t gt e GH E he JER Ibo l vs erties X Toolbox x n Formd vb Start Page x Properties ax All Windows Forms Make Same Width 5 Common Controls a Tal A zl g R Pointer E a3 Forml take SPAA ETE Button 5 5 Cc m Z CheckBox a SayHello Accessiblel E 85 CheckedListBox s x ma Accessible EF ComboBox 0 o E Accessiblef Default TA DateTimePicker BackColor C f kLa
7. igure 1 9 Select the textbox and select the Properties tool window you can press F4 to automatically open the Properties tool window Use the scrollbar to locate the Name property and set it to txt ToSay Repeat for the button control naming it btnSayHel1lo and setting the Text property to Say Hello Y GettingStarted Microsoft Visual Studio ne x File Edit View Project Build Debug Data Tools Test Window Help D o oo s4 33B 9 G DP Debug gt Any CPU Bt A E To alk 3 21 fod Oe ome 205 oop oe ai Bt St E E TES e pennn 72X Formlvb Design Formlivb Start Page gt PE ini All Windows Forms txtToSay System Windows Common Controls 3 n z Pointer E ag Forml EA ez 44 ga Button q Desigr a E CheckBox Say Hello DEIN ttTosay ES CheckedListBox es GenerateM True FE ComboBox Q 9 Locked False A DateTimePicker a Modifiers Friend A Label s CausesValic True E Layout Anchor Top Left Dack None ac 2 MaskedTextBox Name fl MonthCalendar s l_Notifulenn ig Server Explorer 3 Toolbox CJSol g Cle SRP ro Ready Indicates the name used in Figure 1 9 Part Integrated Development Environment 10 4 When a form is opened in the editor space an additional command bar is added to the top of Visual Studio 2008 If you select both controls on the form you will see that certain icons on this command bar are enabled Sele
8. l Studio button you will most likely see a dialog indicating that Visual Studio is configuring the development environment When this process is complete Visual Studio 2008 will open ready for you to start work as shown in Figure 1 3 EZ Star Page Mic oe 6 i ae File Edit View Tools Test Window Help CF 6 Ga 3h gt z ae ma 2 Start Page x Solution Explorer Ix a a is Microsoft a e Visual Studio 2008 MSDN Visual Studio Recent Projects How Do I Create A VSCT File For My VSPackage Tue 20 Nov 2007 20 03 27 0800 In this video Hilton Giesenow shows how to make use of the new VSCT xml file format instead of the traditional Command Table Configuration CTC file format for defining the UI elements of your VSPackage Visual Studio 2008 Releases xoqiooy yfad wanes Mon 19 Nov 2007 00 31 36 0800 On Monday Nov 19 Microsoft announced that Visual Studio 2008 and the NET Framework 3 5 were released to manufacturing RTM With more than 250 new features Visual Studio 2008 includes significant enhancements in every edition including Visual Studio Express and Visual Studio Team System Getting Started Visual Studio 2008 Trial Downloads Mon 19 Nov 2007 00 31 01 0800 Get trial versions of Microsoft Visual Studio 2008 which provides an industry leading developer experience for Windows Vista the 2007 Microsoft Office system and the Web Micr
9. m ga Cal Stack B Breakpoints gt Command Wind j JImmediate Wind Ej Output 4 Ready Ln3 Col9 Ch9 INS Figure 1 12 The layout of Visual Studio in Figure 1 12 is significantly different from the previous screenshots as there are a number of new tool windows visible in the lower half of the screen and new command bars at the top When you stop the application you will notice that Visual Studio returns to the previous layout Visual Studio 2008 maintains two separate layouts design 11 Part Integrated Development Environment time and runtime Menus toolbars and various windows have default layouts for when you are editing a project whereas a different setup is defined for when a project is being executed and debugged You can modify each of these layouts to suit your own style and Visual Studio 2008 will remember them It s always a good idea to export your layout and settings see Chapter 3 once you have them set up just the way you like them That way you can take them to another PC or restore them if your PC gets rebuilt Summary You ve now seen how the various components of Visual Studio 2008 work together to build an application As a review of the default layout for Visual Basic programs the following list outlines the typical process of creating a solution 12 1 2 gt 8 9 Use the File menu to create a solution Use the Solution Explorer to locate the form that needs editing and click
10. ment Before we launch into building our first application it s important that we take a step back and look at the components that make up the Visual Studio 2008 IDE Menus and toolbars are positioned along the top of the environment as in most Windows applications and a selection of sub windows or panes appears on the left and right of the main window area In the center is the main editor space Whenever you open a code file an XML document a form or some other file it will appear in this space for editing With each file you open a new tab is created so that you can toggle among opened files On either side of the editor space is a set of tool windows These areas provide additional contextual information and functionality In the case of the general developer settings the default layout includes the Solution Explorer and Class View on the right and the Server Explorer and Toolbox on the left The tool windows on the left are in their collapsed or unpinned state If you click on a tool window s title it will expand it will collapse again when it no longer has focus or you move the cursor to another area of the screen When a tool window is expanded you will see a series of three icons at the top right of the window similar to those shown in the left image of Figure 1 4 Solution Explorer 2x Solution Explorer BLE E a Floating x Dockable Tabbed Document Auto Hide Hide E Figure 1 4 If you want the tool window to
11. nts This is of course the mandatory Hello World sample that every developer needs to know and it can be done in either Visual Basic NET or C depending on what you feel more comfortable with 1 Start by selecting File gt New gt Project This will open the New Project dialog as shown in Figure 1 6 A couple of new features are worth a mention here Based on numerous feedback requests this dialog is now resizable More importantly there is an additional drop down box in the top right hand corner which is used to select the version of the NET Framework that the application will target The ability to use a single tool to create applications that target different framework versions means that developers can use fewer products and can take advantage of all the new features even if they are maintaining an older product Part Integrated Development Environment Project types Templates NET Framework3 5 v j amp B a Visual Basic Visual Studio installed templates i Windows windows Forms Application E Class Library web i WPF Application 82 WPF Browser Application Smet Pence Ei Console Application E Empty Project piles Sl Windows Service amp WPF Custom Control Library Reporting 8 WPF User Control Library l Windows Forms Control Library Test My Templates WCF G Search Online Templates Workflow Visual C Visual C i Other Project Types Test Projects A project for creating an ap
12. osoft NET Framework 3 5 Runtime Now Available Mon 19 Nov 2007 00 30 26 0800 NET Framework 3 5 builds incrementally on the new features added in NET Framework 3 0 us and is now available as a separate download How Do I Read and Write Selected Text and Position in a Sour Tue 13 Nov 2007 21 41 24 0000 In this video Dylan Miles shows you how to read and write selected text and position within a What s new in Visual Studio 2008 Samples and Walkthroughs Use a Starter Kit New Project From Existing Code How Do L A Solution Explorer E3 Class View Ti Ready Figure 1 3 Regardless of the environment settings you selected you will see the Start Page in the center of the screen However the contents of the Start Page and the surrounding toolbars and tool windows can vary At this stage it is important to remember that your selection only determined the default settings and that over time you can configure Visual Studio to suit your working style The contents shown in the right hand portion of the Start Page are actually just the contents of an RSS feed You can change this to be your favorite blog or even a news feed so you can catch up on the latest news while your solution is loading by changing the news channel property on the Environment gt Startup node in the Options dialog accessible via the Options item on the Tools menu Part Integrated Development Environ
13. plication with a Windows user interface NET Framework 3 5 Name WindowsApplicationl Location C Users nrandolph Documents Visual Studio 2008 Projects Browse Solution Name WindowsApplication1 Create directory for solution Figure 1 6 Select the Windows Forms Application from the Templates area this item exists under the root Visual Basic and Visual C nodes or under the sub node Windows and set the Name to GettingStarted before selecting OK This should create a new windows application project which includes a single startup form and is contained within a GettingStarted solution as shown in the Solution Explorer window of Figure 1 7 This startup form has automatically opened in the visual designer giving you a graphical representation of what the form will look like when you run the application You will notice that there is now an additional command bar visible and that the Properties tool window is in the right tool windows area 7 ie W GettingStarted Microsoft Visual Studio ele x File Edit View Project Build Debug Data Format Tools Test Window Help MT A BIO p Debug o 3 Bt Le AD St at ad ER al E ote 205 Oe Oe a at at at EH Eel Tu aa dle jip Form1 vb Design lt Formiivb kiStarkP na pen Explorer Solution 4 X HE peeaoaa a romi foyer fa Solution GettingStarted 1 project E S G GettingStarted
14. rosoft Visual Basic ne o Microsoft Visual C fez Microsoft Visual C i Visual Studio Tools for Office Telaah ph heey Visual Web Developer Visual Studio 2008 Figure 1 1 Part Integrated Development Environment More importantly the Visual Studio splash screen includes a list of the main components that have been installed If you install third party add ins you may see those products appear in this list The first time you run Visual Studio 2008 you will see the splash screen only for a short period before you are prompted to select the default environment settings It may seem unusual to ask those who haven t used a product before how they imagine themselves using it As Microsoft has consolidated a number of languages and technologies into a single IDE that IDE must account for the subtle and sometimes not so subtle differences in the way developers work If you take a moment to review the various options in this list as shown in Figure 1 2 you ll find that the environment settings that will be affected include the position and visibility of various windows menus and toolbars and even keyboard shortcuts For example if you select the General Development Settings option as your default preference this screen describes the changes that will be applied e Visual Studio 2008 Before you begin using Visual Studio for the first time you need to specify the type of development activity you engage in the most such as
15. t Window Help 13 6 s a b wbug B Z 7 Forml vb Ep Claes View e Solution Explorer Pma Tx Formi System Windows Forns Form ero Fale Formi 4 f UselVaitCursee False a H Text The test associated with the control 23 185x190 Resdy Figure 1 5 The other thing to note about the left image of Figure 1 5 is that the editor space has been divided into two horizontal regions If you right click an existing tab in the editor space you can elect to move it to a new horizontal or vertical tab group This can be particularly useful if you are working on multiple forms or if you want to view the layout of a form while writing code in the code behind file In the right image of Figure 1 5 the editor space is no longer rendered as a series of tabs Instead it is a series of child windows in classic multiple document interface style Unfortunately this view is particularly limiting because the child windows must remain within the bounds of the parent window making it unusable across multiple monitors To toggle between tabbed and multiple document window layouts simply select the Environment gt General node from the Options dialog Develop Build and Debug Your First Application Now that you have seen an overview of the Visual Studio 2008 IDE let s walk through creating a simple application that demonstrates working with some of these compone
16. the View Designer button to show it in the main workspace area Drag the necessary components onto the form from the Toolbox Select the form and each component in turn and edit the properties in the Properties window Use the Solution Explorer to locate the form and click the View Code button to access the code behind the form s graphical interface Use the main workspace area to write code and design the graphical interface switching between the two via the tabs at the top of the area Use the toolbars to start the program If errors occur review them in the Error List and Output windows Save the project using either toolbar or menu commands and exit Visual Studio 2008 While many of these actions can be performed in other ways for instance right click the design surface of a form and you ll find the View Code command this simplified process shows how the different sections of the IDE work in conjunction with each other to create a comprehensive application design environment In subsequent chapters you ll learn how to customize the IDE to more closely fit your own working style and how Visual Studio 2008 takes a lot of the guesswork out of the application development process You will also see a number of best practices for working with Visual Studio 2008 that you can reuse as a developer
17. y Hello button the execution will halt at this line Figure 1 12 illustrates this breakpoint being reached The data tip which appears when the mouse hovers over the line shows the contents of the txt ToSay ext property GettingStarted Debugging Microsoft Visual Studio kala File Edit View Project Build Debug Tools Test Window Help aa Med Sa S Debug j fanycru BGs fiee iD oo a gt Se CS Se He S B Li eR oe Brodin SeawaAa Qs i Process 5188 GettingStarted vsh Thread 6076 Main Thread a E stack Frame GettingStarted exe GettingSt z ior a ry Forml vb Design Form1 vb x Solution Explorer S A X i Iase J btnSayHello F Click iij SE 5 DA Solution GettingStarted 5 Public Class Formi o GA GettingStarted b Private Sub btnSayHello Click ByVal sender As System Object ByVal e As System Event zi BA My Project Hi SSS age noes ea E EEEN ke Sj Formi vb f End Sub T Me txtToSay Text Hello World i End Class Autos FX Call Stack aix Name Value Type a Name Lance E Me GettingStarted Form1 GettingSt GettingStarted exe GettingStarted Form 1 btnSayHello_Click Object sender Text Basic E af Me txtToSay Text Hello World System External Code ap Me txtToSay Text He rid String 29e X 59 Y 12 Button Left 1048576 System E sender Text Say Hello Object Autos E Locals g Watch 1 o 7
Download Pdf Manuals
Related Search
Related Contents
Iridium Manuale utente User manual Benutzerhandbuch MANUAL DEL SISTEMA DE INFORMACION installazione installation Soler & Palau Artic-255 N SURVEYOR Scan KRAS Mutation Detection Kit Exon 2 CE IVD mit Sendmail ESPAÑOL Copyright © All rights reserved.
Failed to retrieve file