Visual Basic Tutorial Lesson 37: Adding Menus for Your Application #free #visual

#

Lesson 37: Creating Menus for Your Applications

The menu bar is the standard feature of most Windows applications. The main purpose of the menus is for easy navigation and control of an application. Some of the most common menu items are File, Edit, View, Tools, Help and more. Each item on the main menu bar also provides a list of options in the form of a pull-down menu. When you create a Visual Basic 6 program, you need not include as many menu items as a full-fledged Windows application. What you need is to include those menu items that can improve the ease of usage by the user. There are two ways to add menus to your application, using the Visual Basic’s Application Wizard and or the menu editor.

37.1 Adding Menu Bar Using Visual Basic’s Application Wizard

The easiest way to add a menu bar to your application is by using Visual Basic’s Application Wizard. This wizard allows the user to insert fully customized standard Windows menu into his or her application. To start using Visual Basic’s Application Wizard, click on the Application Wizard icon at the Visual Basic new project dialog box, as shown in Figure 37.1 below:

Figure 37.1: New Project Window

When you click on the VB Application wizard, the introduction dialog box will appear, as shown in Figure 37.2. As you are not loading any default setting, just click on the Next button.

Figure 37.2

After clicking the Next button, the interface type dialog box will be displayed, as shown in Figure 37.3. There are three choices of interface available for your project. As we currently not creating a Multiple Document Interface (MDI), we choose Single Document Interface (SDI). You can also type the project name in the textbox below, here I am using MyFirstMenu.

Figure 37.3

Clicking the Next button wiill bring up a list of menus and submenus that you can add them to your application. Check to select a menu item and uncheck to unselect a menu item as shown in Figure 37.4. Let say we choose all the menus and click next, then you will get an interface comprises File, Edit, View and Help menus, as shown in Figure 37.5

Figure 37.4

Figure 37.5

When you click on any menu item, a list of drop-down submenu items will be displayed. For example, if you click on the File menu, the list of submenu items such as New, Open, Save, Save As and more will be displayed, as shown in Figure 37.6

Figure 37.6

Clicking on any of the dropped down menu item will show the code associated with it, and this is where you can modify the code to suit your programming needs. For example, clicking on the item Open will reveal the following code:

Figure 37.7

Now, I will show you how to modify the code in order to open a graphic file and display it in an image box. For this program, you have to insert a Image box into the form. Next add the following lines so that the user can open graphic files of different formats.

Filter = Bitmaps(*.BMP)|*.BMP|Metafiles(*.WMF)|*. WMF|Jpeg Files(*.jpg)|*.jpg|GIF Files(*.gif)|*.gif|Icon Files(*.ico)|*.ico|All Files(*.*)|*.* .

Then, you need to load the image into the Image box with the following code:

Also set the Stretch property of the Image box to true so that the image loaded can resize by itself. Please note that each menu item is a special control, so it has a name too. The name for the menu File in this example is mnuFileOpen.

The Code

When you run the program and click on the File menu and then the submenu Open, the following Open dialog box will be displayed, where you can look for graphic files of various formats to load it into the image box.

Figure 37.8

For example, selecting the jpeg file will allow you to choose the images of jpeg format, as shown in Figure 37.9.

Figure 37.9

Clicking on the particular picture will load it into the image box, as shown in Figure 36.10 below

Figure 37.10

37.2: Adding Menu Bar Using Menu Editor

To start adding menu items to your application, open an existing project or start a new project, then click on Tools in the menu bar of the Visual Basic IDE and select Menu Editor. When you click on the Menu Editor, the Menu Editor dialog will appear. In the Menu Editor dialog. key in the first item File in the caption text box. You can use the ampersand ( ) sign in front of F so that F will be underlined when it appears in the menu, and F will become the hot key to initiate the action under this item by pressing the Alt key and the letter F. After typing File in the Caption text box, move to the name textbox to enter the name for this menu item, you can type in mnuFile here. Now, click the Next button and the menu item File will move into the empty space below, as shown in Figure 37.11:

Figure 37.11

You can then add in other menu items on the menu bar by following the same procedure, as shown in Figure 37.12 below:

Figure 37.12

When you click Ok, the menu items will be shown on the menu bar of the form.

Figure 37.13

Now, you may proceed to add the sub menus. In the Menu Editor, click on the Insert button between File and Exit and then click the right arrow key, and the dotted line will appear. This shows the second level of the menu, or the submenu. Now key in the caption and the name. Repeat the same procedure to add other submenu items. Here, we are adding New, Open, Save, Save As and Exit.

Figure 37.14

Now click the OK button and go back to your form. You can see the dropped down submenus when you click on the item File, as shown.

Figure 37.15

Finally, you can enter the code by clicking on any of the submenu items.





Next programming language #programming, #software #development, #devops, #java, #agile, #web, #iot, #database,

#

Why .NET Core Made C# Your Next Programming Language to Learn

Why .NET Core Made C# Your Next Programming Language to Learn

Get Your Apps to Customers 5X Faster with RAD Studio

For years I have read about polyglot programmers and how some new language was the new cool thing. Over time, it has been programming languages like Ruby, Python, Scala, Go, Node.js, Swift, and others. It is amazing to see what Microsoft, and the community, have done with .NET Core and how it has become the cool new thing.

The problem with many of the existing programming languages is they are good at one use case. Ruby and PHP are awesome for web applications. Swift or Objective-C are great for creating iOS or MacOS applications. If you wanted to write a background service you could use Python, Java, or other languages. Besides C#, JavaScript and Java may be the only languages that can be applied to a wide set of use cases.

It is hard for me to apply my skills to a broad set of problems if I have to learn many programming languages. It limits my job opportunities. The awesome thing about C# is the wide versatility of it that can be used for a wide variety of types of applications. Now with .NET Core working on MacOS and Linux, there truly is no limit to what you can do. We will explore this in more detail below.

Why C# and .NET Core Are the Next Big Thing

I have been playing with .NET Core for over a year now and have been very impressed with it. I have even ported a .NET app over to run on a Mac, which was pretty amazing to see in action after all these years!

Since our company creates developer tools that also work with .NET Core, I feel like we are more plugged in to what is going on. It feels like .NET Core is picking up steam fast and I predict there will be a huge demand for .NET Core developers in 2018. We talk to customers every day who are already running .NET Core apps in production.

According to the TIOBE programming index. C# is already one of the top 5 programming languages.

Top 6 Things to Know About C# and .NET Core

If you are thinking about learning a new programming language, I want to provide you some of my insights as to why C# and .NET Core should be on the top of your list.

Easy to Learn

If you have done any programming in C, Java, or even JavaScript, the syntax of C# will feel very familiar to you. The syntax is simple to understand and read. Based on the TIOBE index I posted above, there are millions of developers who could easily make the switch from Java or C.

There are lots of online resources to help you learn C#. Many are free and there are some that are low cost as well.

Modern Language Features

NET has been around a long time now and has steadily changed and improved over 15 years. Over the years I have seen awesome improvements like MVC, generics, LINQ, async/await, and more. As someone who has personally dedicated myself to the language, it is awesome to see it improve over time. With .NET Core, a lot has changed, including all of the ASP.NET stack being completely overhauled.

Here are some the top features:

  • Strongly typed.
  • Robust base class libraries.
  • Asynchronous programming – easy to use async/await pattern.
  • Garbage collection, automatic memory management.
  • LINQ – Language Integrated Queries.
  • Generics – List T , Dictionary T, T .
  • Package management.
  • The ability to share binaries across multiple platforms and frameworks.
  • Easy to use frameworks to create MVC web apps and RESTful APIs.

Versatility: Web, Mobile, Server, Desktop

One of the best things about C# and .NET is the versatility of it. I can write desktop apps, web applications, background services, and even mobile apps thanks to Xamarin. Besides C#, all I really have to know is a little JavaScript (aided by TypeScript) to hack some UI code together (which I still try to avoid!). ASP.NET Core templates even make use of Bootstrap layouts and npm for pulling in client-side libraries.

The versatility is a big deal because your investment in learning the language can be used for a wide array of things. Your skillset is highly portable. You can also jump from building web apps to mobile apps if you want to mix up what you are doing. This is a stark difference to most other programming languages that only work server side.

And let’s not forget the first class support for Microsoft Azure. It’s never been easier to get up and running and then deployed to the cloud in just a few clicks. Docker containers are also supported which makes it easy to deploy your app to AWS or other hosting providers as well.

Awesome Developer Tools

Visual Studio has always been regarded as one of the best IDEs available for developers. It is a great code editor that supports features like code completion, debugging, profiling, git integration, unit testing, and much more. Visual Studio now offers a full-featured, free Community edition.

It is also possible to write code for .NET Core as basic text files with your favorite text editor. You can also use Visual Studio Code on any OS as a great basic code editor. For those of you who will never give up your vim or emacs, you can even do C# development too. You could also install a plug-in for Visual Studio to add all of your favorite shortcut keys.

The whole .NET ecosystem is also full of amazing developer tools. For example, I couldn’t imagine living without Resharper from Jetbrains. There are dozens of awesome tools that exist, including a mixture of open source and commercial products.

Standardization of Skills

NET comes with a very good set of base class libraries. Unlike Node.js, simple string functions like LeftPad() are built in. The wide array of base classes really decreases the need for external packages. Microsoft does lean on some community projects as well, like JSON.NET, to be key libraries widely used in most projects.

Microsoft provides a very good set of patterns and practices for .NET. For example, there are standard data access (entity framework) and model-view-controller (MVC) frameworks built-in. Most developers use those standard frameworks. This makes it easy as a developer to move between teams and quickly understand how things work. Your knowledge and skills become more portable due to this.

.NET Core Is Open Source

One of the biggest changes to ever happen to .NET was the open sourcing of the code. Virtually all of the code is now on GitHub for anyone to review, fork, and contribute to. This is a huge change that most people in the industry never thought would happen.

As a developer, from time to time you need to look under the covers to see what your code is really doing. For example, in the past, I once wondered if I called Dispose() on a database connection if that closes the connection or not. If you can access the source code somehow, you can quickly verify these types of questions.

Even if you don’t contribute to the source code, you benefit from the huge community that is. Problems and improvements are quickly discussed, coded, and released for you to use on a regular basis. Gone are the days of waiting years in-between releases for major improvements or minor bug fixes.





Software development magazine: software testing, project management, Agile, Scrum, DevOps, programming, requirements

#

Methods Tools is a free software development magazine on Project Management, Software Testing, Agile, Scrum,
Lean, Kanban, Requirements ( User Stories, UML, Business Analysis), Programming, Databases, User Experience (UX)
Open Source Tools, Software Process Improvement, Software Architecture, Peopleware, Mobile Apps
Subscribe to Methods Tools if you are not afraid to read more than one page to get smarter!

Last Articles Published by Methods Tools

Lean UX and the Language of Change
Learn how the language used in a Lean UX approach can help uniting the team and solving customers problems.

Project Deadlines are Elastic by Value
There is nothing wrong with deadlines but deadlines should come from business need, not effort estimates which are magically transformed into deadlines.

Improve Software Testing with Containers
This article presents how container technology improves different software testing tasks and its benefits.

Automated Testing Strategy for a Microservices Architecture
This article explains how adopting microservices opened up new ways to design automated end-to-end system tests.

Agile Forecasting: Asking Why and Discovering What is Behind the When
Forecasting is guesswork, it may be scientific guesswork and it may be based on past experience, metrics, and clever projection tools, but it is a guess. You will be wrong far more often than you are right.

InversifyJS – IoC container for JavaScript, TypeScript Node.js
InversifyJS is an inversion of control library that works with frontend and backend JavaScript applications like Node.js.

Codetrack – Free .NET Performance Profiler and Execution Analyzer
Codetrack is a free performance profiler and execution analyzer for .NET applications.

Ada: a C Developer’s Perspective
Learn how the Ada programming language helps solving modern software development challenges like coding for IoT.

Explore the best in Agile practices Agile2017, August 7-11 2017, Orlando, USA
Recommended project management software for Agile teams and enterprises
TimeShiftX – Test automation software for date shift testing time travel of applications.
TestMatick – independent software testing and quality assurance company
Discover the best available Open Source Project Management Tools





Plc programming training online #plc #programming #training #online

#

PLCdev is your home for quality simulators for Programmable Logic Controllers from Allen Bradley. GE Fanuc. Siemens. Modicon. Mitsubishi. Omron. Automation Direct and anything else you’re using. We specialize in making PLC test boards to simulate your control environment so that you can debug your programs on your desk or in the field. And if that wasn’t enough we offer educational materials, articles and tips for the novice to the advanced programmer. We invite you to register so that you can receive timely updates to PLCdev. Thanks for coming and visit again soon!

This is the second article in a series that shows how to create user defined function blocks using Modicon Concept v2.6 programing software. This article will show how to create an integrator function block.

Many basic control system component blocks contain an integrator function. Some examples are PID, Lead-Lag and filter blocks. An integrator function has an output that is the time integral of the input signal.

A PLC (Programmable Logic Controller) is used for the control of industrial machines and process installations. The PLC was designed specially for this purpose and offers the possibility of a flexible configuration by means of hardware and software to be adapted to the machine or process which needs to be controlled. Analog signals such as pressure and temperature from the process are evaluated by the PLC and based on these signals the process is controlled by the PLC. Analog signals need to be connected to the PLC and configured. Because of the modular design and configuration of the PLC many things can go wrong. This article gives some guidelines.

This article will show how to create user defined function blocks. The first block, a summing junction, was chosen to be simple in nature to illustrate the steps in creation without unnecessary complication. Future articles will not be as in depth with creation mechanics and spend more effort on the functionality. The culmination of these series of articles will be a functional turbine speed control. The programming package for this series is Modicon Concept v2.6s.