{"id":833,"date":"2007-09-06T01:54:18","date_gmt":"2007-09-06T06:54:18","guid":{"rendered":"http:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005"},"modified":"2008-01-31T21:26:42","modified_gmt":"2008-02-01T02:26:42","slug":"build-your-first-application-with-vb-express-2005","status":"publish","type":"post","link":"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005","title":{"rendered":"Build your first application with VB Express 2005"},"content":{"rendered":"

Once you have installed VB Express 2005 using this tutorial: VB Install<\/a>, you can start to build your applications. We will start with a few minor features of VB to make a very primitive application and create an EXE from it.<\/o><\/span><\/p>\n

<\/o><\/span><\/p>\n

First, we need to launch VB Express 2005 to get to the Start Page shown below:<\/o><\/span><\/p>\n

<\/o><\/span>\"build_a_vb_app_01\"<\/a><\/p>\n

This is the \u201chome page\u201d of VB Express. This will give you news and updates, and allows you to start or open a project to be worked on.<\/o><\/span><\/p>\n

\"build_a_vb_app_02\" <\/o><\/span><\/p>\n

Click on the hyperlinked Project button to begin building a new project.<\/o><\/span><\/p>\n

<\/o><\/span>\"build_a_vb_app_03\"<\/a><\/p>\n

The above window will appear, asking you to name your project and to select what kind of project it is going to be. For this tutorial, we are going to use the generic Windows Application selection, and call it \u201cBuild\u201d.<\/span> <\/span><\/o><\/p>\n

<\/o><\/span>\"build_a_vb_app_04\"<\/a><\/p>\n

This is the main development interface. If you get big into VB programming, this will be like home. <\/span><\/span><\/span>The main parts of this interface are detailed below.<\/o><\/span><\/p>\n

<\/o><\/span>\"build_a_vb_app_05\"<\/p>\n

First, we have the toolbox. This is where you visually pick what you want to put on your form (the application). You will see common thing suck as buttons, text boxes, labels, and more. These items all describe themselves fairly well. To put them on a form you select one, then click (and drag if you can choose the size) on the form where you would like it to go. You can move and resize them after they are on the form, so it doesn\u2019t have to be perfect now.<\/o><\/span><\/p>\n

<\/o><\/span>\"build_a_vb_app_06\"<\/a><\/p>\n

This is the section where the GUI(Graphical User Interface) is displayed when you are working on the Front end, and where the code is displayed when you are working on the code. As you can see, it is tab driven which allows you to have multiple screens, forms, and code listing open all at once.<\/o><\/span><\/p>\n

<\/o><\/span>\"build_a_vb_app_07\"<\/p>\n

Next we have the solution explorer. (This is usually set to only appear when you move your mouse to the right side of the screen; it will then slide out for you to see it. If you want it like I have it, you can click on the push pin icon at the top to make it stay in place.) This allows you to see all the scripts, icons, forms, and controls that are in your project. All we have now is our main form. <\/o><\/span><\/p>\n

\"build_a_vb_app_08\"
\n<\/o><\/span><\/p>\n

Last, but definitely not least, we have the Properties windows. This window shows you all of the options for whatever you have selected in the graphical interface. For example, if I had selected a label, I would see all of the configurable options for a label like: name, text (shown on the screen), font size, color, background color, and size. As you select the option to modify it, it will give you a description of what it does or what it modifies in the box at the bottom of the window. <\/o><\/span><\/p>\n

\"build_a_vb_app_09\"
\n<\/o><\/span><\/p>\n

Next, we want to start building our form. When you place things on to the form in the future, you will want to remember to have a naming convention to follow, so you will be able to remember what you called things. I usually make an abbreviation for the type of object it is. For example, I will call text box that collects a user name \u201ctxtUser\u201d or a label that showed the user name \u201clblUser\u201d. After you place the label, look at the property window, it will now show you the option of \u201cText\u201d. Click on it an type in \u201cThe button has been pressed\u201d for the first one and \u201ctimes\u201d for the second one. For this tutorial don\u2019t change anything else. <\/o><\/span><\/p>\n

\"build_a_vb_app_10\"<\/a>
\n<\/o><\/span><\/p>\n

Next, we want to double click on the button that we placed on the form. This will take you to the code view and automatically set you up to start writing the code. Private_Sub Button1_Click tells you the name of the \u201csection\u201d of code. All of the stuff after it (ByVal ect\u2026.) for the sake of this tutorial, can be ignored. You will most likely not have to modify it in any basic programming that you do. The two cells at the top of the page show you what object you are writing code for (on the left) and what command, or action will trigger that code (on the right). So, in this case we are writing code that will be executed when Button1 is clicked. The bottom of this screen shows you if you have any errors in the code that you have typed and will alert you to where they are. It will also try to help you figure out why it is wrong. <\/o><\/span><\/p>\n

\"build_a_vb_app_11\"<\/a>
\n<\/o><\/span><\/p>\n

This is all the code we will need to make this application function. Lets break down some of this code:<\/o><\/span><\/p>\n

\u201cPublic Class Form1\u201d \u2013 This indicates that everything from this point, until the \u201cEnd Class\u201d code is for Form1. <\/o><\/span><\/p>\n

\u201cDim stramount as integer\u201d \u2013 This gets a word ready to be used as a variable of some sort. In this case I have made it an integer, as it will only and always be a number. These have to go right after the Class command or they will not be available from all Subs. <\/o><\/span><\/p>\n

\u201cIf, Else, End If.\u201d \u2013 This is one of the most common and basic commands in VB. It simply tells it to check something, and if it is true do option a, and if its not, do option b. In this case, we are checking for stramount to be equal to 99 and if it is to alert the user with a message box, so that they know they have reached the limit of the textbox I made. If stramount is not equal to 99 it simply makes stramount equal to itself plus one (adds one to the value of stramount.).<\/o><\/span><\/p>\n

\u201cTextbox1.text = stramount\u201d \u2013 this makes the textbox that we made show the value of the integer. <\/o><\/span><\/p>\n

So, every time the button is clicked, it checks the value of stramount, runs the code based on its result, and finally updates the textbox with the value. <\/o><\/span><\/p>\n

<\/o><\/span><\/p>\n

\"build_a_vb_app_12\"<\/p>\n

This control bar at the top of the screen allows you to Undo code and object changes, redo code and object chngaes, start debugging (run the application) pause debugging, and stop debugging. <\/o><\/span><\/p>\n

\"build_a_vb_app_13\"
\n<\/o><\/span><\/p>\n

Click on Start Debugging to launch the application. It will show us our form. Press the button and the box should change to 1. Press it again and it should increase. It will continue to increase until it reaches 99 and you press it again, you will then see this: <\/o><\/span><\/p>\n

\"build_a_vb_app_14\"
\n<\/o><\/span><\/p>\n

Now that it works the way we want to, we want to build it so that we can give it to other people to use. First go to Build<\/span><\/span>><\/span>Build (App Name), to make sure the application can successfully create the exe. Once that completes, goto Build<\/span><\/span>><\/span>Publish (App Name). The following windows will come up.<\/o><\/span><\/p>\n

\"build_a_vb_app_15\"<\/a><\/span> <\/span><\/o><\/p>\n

This window allows you to pick were you want to build the application at. I usually put a folder on the desktop for my builds, at least until I\u2019m done with them. To do this, click on browse:<\/o><\/span><\/p>\n

<\/o><\/span>\"build_a_vb_app_16\"<\/a><\/p>\n

You will get this window. Select Desktop at the top of the tree view dialog. Then add the name of what you want to call the folder onto the end of the address. Click on Open.<\/o><\/span><\/p>\n

<\/o><\/span>\"build_a_vb_app_17\"<\/a><\/p>\n

You will be prompted to Create the folder. Click Yes. Once you do this, it will take you back to the original screen. Click on Finish to build the project. Once it finished building you should then see the folder you called it on your desktop. Open this folder.<\/o><\/span><\/p>\n

\"build_a_vb_app_20\"<\/a>
\n<\/o><\/span><\/p>\n

Inside this folder, you will see the above contents. There are two ways of running your application. First you can run the \u201csetup.exe\u201d. Or you can just run the EXE. I will cover both. First, the setup. Click on \u201csetup.exe\u201d to launch the application installation. <\/o><\/span><\/p>\n

<\/o><\/span>\"build_a_vb_app_18\"<\/a><\/p>\n

This window will pop up to alert you that you are about to install and unknown publishers application. Of course it\u2019s unknown, Microsoft doesn\u2019t know you personally. Click on install to continue with the install and it will finish automatically. Once it is done, it will automatically launch the application. If you go to your Start Menu, you will see that a folder has been created for you application. <\/o><\/span><\/p>\n

<\/o><\/span>\"build_a_vb_app_19\"<\/a><\/p>\n

You will also notice that it is in the Add\/Remove programs in the Control Panel:<\/o><\/span><\/p>\n

\"build_a_vb_app_23\"<\/a>
\n<\/o><\/span><\/p>\n

The second method is to run the EXE without creating\/installing all the other stuff. In order to do this, simply go back to the folder on the desktop and go into the folder called Build_1_0_0_0. It will be different every time, but there will always be a folder there. Once you go into it you will see a file that looks like this: <\/o><\/span><\/p>\n

\"build_a_vb_app_21\"
\n<\/o><\/span><\/p>\n

If you don\u2019t see the .deploy at the end, follow this tutoral<\/a>, to ensure you are showing file extensions of known files. Simply remove the .deploy and then you can run the application with the EXE. You can now put it anywhere on your hard drive and run it. <\/o><\/span><\/p>\n

\"build_a_vb_app_22\"
\n<\/o><\/p>\n","protected":false},"excerpt":{"rendered":"

Unfamiliar with Visual Basic 2005? This tutorial will walk you through making a very simple application. You will learn how to build the application for deployment and how to use it after you are completed. <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[25,26],"tags":[],"yoast_head":"\nBuild your first application with VB Express 2005<\/title>\n<meta name=\"description\" content=\"Unfamiliar with Visual Basic 2005? This tutorial will walk you through making a very simple application. You will learn how to build the application for deployment and how to use it after you are completed.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mike Maguire\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/teamtutorials.com\/#website\",\"url\":\"https:\/\/teamtutorials.com\/\",\"name\":\"Team Tutorials\",\"description\":\"Learn something new today\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/teamtutorials.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/teamtutorials.com\/wp-content\/uploads\/2007\/09\/vb_build_01.thumbnail.JPG\",\"contentUrl\":\"http:\/\/teamtutorials.com\/wp-content\/uploads\/2007\/09\/vb_build_01.thumbnail.JPG\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005#webpage\",\"url\":\"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005\",\"name\":\"Build your first application with VB Express 2005\",\"isPartOf\":{\"@id\":\"https:\/\/teamtutorials.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005#primaryimage\"},\"datePublished\":\"2007-09-06T06:54:18+00:00\",\"dateModified\":\"2008-02-01T02:26:42+00:00\",\"author\":{\"@id\":\"https:\/\/teamtutorials.com\/#\/schema\/person\/eb38d967529dbe49f7cbe082fd39105b\"},\"description\":\"Unfamiliar with Visual Basic 2005? This tutorial will walk you through making a very simple application. You will learn how to build the application for deployment and how to use it after you are completed.\",\"breadcrumb\":{\"@id\":\"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/teamtutorials.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Build your first application with VB Express 2005\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/teamtutorials.com\/#\/schema\/person\/eb38d967529dbe49f7cbe082fd39105b\",\"name\":\"Mike Maguire\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/teamtutorials.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/36f2aa9a11241ca79ed05e758e36f3cb?s=96&d=mm&r=r\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/36f2aa9a11241ca79ed05e758e36f3cb?s=96&d=mm&r=r\",\"caption\":\"Mike Maguire\"},\"sameAs\":[\"http:\/\/mikemaguire.me\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Build your first application with VB Express 2005","description":"Unfamiliar with Visual Basic 2005? This tutorial will walk you through making a very simple application. You will learn how to build the application for deployment and how to use it after you are completed.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005","twitter_misc":{"Written by":"Mike Maguire","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/teamtutorials.com\/#website","url":"https:\/\/teamtutorials.com\/","name":"Team Tutorials","description":"Learn something new today","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/teamtutorials.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005#primaryimage","inLanguage":"en-US","url":"http:\/\/teamtutorials.com\/wp-content\/uploads\/2007\/09\/vb_build_01.thumbnail.JPG","contentUrl":"http:\/\/teamtutorials.com\/wp-content\/uploads\/2007\/09\/vb_build_01.thumbnail.JPG"},{"@type":"WebPage","@id":"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005#webpage","url":"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005","name":"Build your first application with VB Express 2005","isPartOf":{"@id":"https:\/\/teamtutorials.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005#primaryimage"},"datePublished":"2007-09-06T06:54:18+00:00","dateModified":"2008-02-01T02:26:42+00:00","author":{"@id":"https:\/\/teamtutorials.com\/#\/schema\/person\/eb38d967529dbe49f7cbe082fd39105b"},"description":"Unfamiliar with Visual Basic 2005? This tutorial will walk you through making a very simple application. You will learn how to build the application for deployment and how to use it after you are completed.","breadcrumb":{"@id":"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/teamtutorials.com\/programming-tutorials\/build-your-first-application-with-vb-express-2005#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/teamtutorials.com\/"},{"@type":"ListItem","position":2,"name":"Build your first application with VB Express 2005"}]},{"@type":"Person","@id":"https:\/\/teamtutorials.com\/#\/schema\/person\/eb38d967529dbe49f7cbe082fd39105b","name":"Mike Maguire","image":{"@type":"ImageObject","@id":"https:\/\/teamtutorials.com\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/36f2aa9a11241ca79ed05e758e36f3cb?s=96&d=mm&r=r","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/36f2aa9a11241ca79ed05e758e36f3cb?s=96&d=mm&r=r","caption":"Mike Maguire"},"sameAs":["http:\/\/mikemaguire.me"]}]}},"_links":{"self":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/posts\/833"}],"collection":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/comments?post=833"}],"version-history":[{"count":0,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/posts\/833\/revisions"}],"wp:attachment":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/media?parent=833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/categories?post=833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/tags?post=833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}