From the course: Visual Basic Essential Training

Create application with common tools - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Start my 1-month free trial

Create application with common tools

- [Instructor] We are going to build our first simple Visual Basic application. My goal is to show the minimun structure you need to create, compile, and run the application. And we're going to make this app with a text editor. Don't worry, we'll use better tools once we get the basics down. I have three tools open on the window, at the top left is a text editor, I'm using Notepad. You can use whatever editor you have available. On the bottom left, I have File Explorer open to a temporary folder I've created on my C Drive. I call this VB Temp. This allows us to see the files created by the compiler. Over on the right side of the screen, I've got the command window open. I'll use this to compile the Visual Basic code. To be clear, you won't use this technique for your daily coding adventures. Visual Studio or Visual Studio code handle the compilation more efficiently. They help us to see the fundamentals of Visual Basic applications. This is a developer-configured command window that is installed with Visual Studio. As you can see, it states at the top that this is a special prompt. It indicates that this one is configured for Visual Studio 2019, which is important because it is configured to work with the Visual Studio and dot net tools. To open this command window, open your start menu. Navigate out to the V section of your applications, and you're looking for some Visual Studio folders. As you can see, I've got lots of Visual Studios installed on this computer. I'm looking for the one in this folder, and this top item: developer command prompt for VS 2019. That'll open this window. Next, you want to change directory to the VB Temp folder. Now I'll run a command to see if I can compile the codes. What I'm looking for the VB compiler, so VBC, and then I'll type in help. Now when that runs, you can see that it is finding the VBC compiler and it's giving me a list of possible commands or switches I can use for this command. This is what we're looking for. It verifies that we can use the compiler in the command window. Here are the steps, I'll follow. I'll add some text to the text editor. Over in the command window, I will attempt to have compiled the file into an application executable with the VBC command. And then we'll see the results. The executable over here in the text editor. So let's try it right now. VBC, and then the name of my file, which is called First App dot txd. And the compiler ran, but I'm getting an error. This is expected since there is no code in the file yet. Now that the tools are ready, let's write some code.

Contents