PC Pro Magazine

Building graphical apps in Visual Studio

Part 2: Creating graphical interfaces

Two months ago (see issue 349, p44) we introduced the free edition of Microsoft Visual Studio, and walked you through setting up your first program in Visual Basic. What we didn’t touch on is the aspect of Microsoft’s IDE that makes it “visual” and sets it apart from many other development environments – namely, the ability to create rich graphical interfaces for your programs.

In fact, that undersells just how powerful the package is. Visual Studio isn’t just about adding buttons and menus to your code: it allows you to design the GUI first, and then slot in event-driven code to make each element work – a wonderfully intuitive and efficient workflow.

To showcase just how easy it can be, this month we’ll walk through the process of creating a sample graphical application in VB that loads in a text file, sort its lines alphabetically and saves the sorted lines under a new name. And to drive it, we’ll build a rich Windows-native interface using standard buttons, text fields and file requesters.

GETTING STARTED

You can begin the project in the usual way, by opening Visual Studio and selecting “Create a new project”. Then, in the project selector window that opens, choose Windows Forms App, making sure you select the Visual Basic template, rather than the C# one. Windows Forms (or WinForms for short) is a framework that lets you use all the standard Windows

You’re reading a preview, subscribe to read more.

More from PC Pro Magazine

PC Pro Magazine8 min readSecurity
How To Earn Cyber Essentials Certification
If your business has any kind of internet connection, it’s at risk. In a recent survey by Deloitte, a full third of executives said their accounting and financial data had been targeted over the past 12 months; in 2022, an incredible three-quarters o
PC Pro Magazine14 min read
Slash Your Bills Build Your Own Smart Home Grid
The standard electricity tariff in the UK is still an eye-watering 28p per kilowatt hour. In February, by “gaming” the variable price tariff he’s on and making the most efficient use of the solar panels and batteries in his home, PC Pro reader Rob Tw
PC Pro Magazine6 min read
Readers’ Comments
Editor-in-chief Tim Danton writes: A huge thanks to everyone who wrote in about their mini PC experience in response to my request last month. Sadly we don’t have space to include all the responses, but I’m grateful to Jeffrey Barfield, David Forth a

Related