Category Archives: Programming Tutorials

A Game Engine From Scratch In JavaScript Part 4 – Editor & Debugger

View post on imgur.com

The editor serves as a live debugger and allows modifying the game objects in real-time. These are canvas sprites we’re talking about, not DOM elements. While this is still a work in progress, I wanted to share a screen capture so you can see how it might end up looking. The next screen capture shows some live editing capabilities.

Continue reading

How to Create a TreeView File Browser Component in VB.NET – Part 2

This tutorial is part of a series: Part 1 | Part 2TreeView Part 2

In Part 1 of this tutorial series, I presented a way to use the .NET TreeView control as a file browser similar to Windows Explorer in functionality. As we navigate through this TreeView, the BeforeExpand event is handled so that each node is dynamically populated as soon as it gets expanded.

The second part of this tutorial focuses on displaying the native system icons for each file and folder in the TreeView.

Continue reading

How to Create a TreeView File Browser Component in VB.NET

Windows Explorer

Windows Explorer's familiar tree navigation.

This tutorial is part of a series: Part 1 | Part 2

As a developer I am often faced with the task of creating a tree-style file browser for navigating the file system similar to Windows Explorer. VB6 provides the DirList and FileList controls, but VB.NET does not provide a control with similar functionality, let alone a full fledged file browser control. It does however include a very nice TreeView control, and with a bit of code you can leverage this powerful control to navigate your file system similar to Windows Explorer.

The idea is pretty simple:

  • Each TreeNode in the TreeView represents a file or folder in the file system.
  • Each TreeNode knows the full path of the file or folder that it represents.
  • Recursion is not used; nodes are populated on demand. When a directory node is expanded by the user, a TreeView event is triggered which clears and repopulates the directory node.

In the first part of this tutorial I’ll show you how to create a simple re-usable File Browser Tree Component by letting the TreeView control do most of the work. In the second part of this tutorial, I’ll show you how to add several features (icons, context menus, drag/drop, etc.) that will spice up your TreeView File Browser Component and bring it more up to par with Windows Explorer.

Continue reading

How to Use Windows Shell Icons in VB.NET

Folder Options

Folder Options

This tutorial explains how to code a simple, reusable Shell Icon Manager component in VB.NET. Windows maintains registered file types and associated icons as seen in the Folder Options dialog box, but there is no way to access them through managed (.NET) code, so we must use Win32 API functions to access them through the Windows shell.

This shell icon manager is useful if you need to:

  • Produce a list of file type / icon associations similar to the “Registered file types” in Windows XP.
  • Get a file’s real icon instead of using icons that look similar, so you can develop an interface that is more streamlined with the native Windows interface.
  • Create a file browser similar to Windows Explorer by tapping into the same icons that Windows Explorer uses. Pair this idea with my other article titled How to Create a TreeView File Browser Component in VB.NET and you’ll have a file browser that closely resembles Windows Explorer.

Continue reading