Check out the new VB.NET and .NET Framework version 4.0!

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)

This post is now Obsolete

Microsoft has had available for alittle while now a beta of their Visual Studio suite which I think is being called: Visual Studio 2010. Below is a simple overview of DotNET 4.0 Beta…

Get low cost Computer and Electronics Here!

Everything you want for your computer and more at


The Microsoft .NET Framework 4 provides the following new features and improvements:

  • The .NET Framework 4 works side by side with the Framework version 3.5 SP1. Applications that are based on earlier versions of the Framework will continue to run on that version. Just a subset of functionality is shared by all versions of the Framework.
  • Innovations in the Visual Basic and C# languages, for example statement lambdas, implicit line continuations, dynamic dispatch, and named/optional parameters.
  • The ADO.NET Entity Framework, which simplifies how developers program against relational databases by raising the level of abstraction, has many new features. These includes persistence ignorance and POCO support, lazy loading, test-driven development support, functions in model, and new LINQ operators.
  • Enhancements to ASP.NET:
    • New JavaScript UI Templates and databinding capabilities for AJAX.
    • New ASP.NET chart control.
  • Improvements in WPF:
    • Added support in Windows Presentation Foundation (WPF) for Windows 7 multi-touch, ribbon controls, and taskbar extensibility features.
    • Added support in WPF for Surface 2.0 SDK.
    • New line-of-business controls including charting control, smart edit, data grid, and others that improve the experience for developers who build data centric applications.
    • Improvements in performance and scalability.
    • Visual improvements in text clarity, layout pixel snapping, localization, and interoperability.
  • Improvements to Windows Workflow (WF) that let developers to better host and interact with workflows. These include an improved activity programming model, an improved designer experience, a new flowchart modeling style, an expanded activity palette, workflow-rules integration, and new message correlation features. The .NET Framework also offers significant performance gains for WF-based workflows.
  • Improvements to Windows Communication Foundation (WCF) such as support for WCF Workflow Services enabling workflow programs with messaging activities, correlation support, durable two-way communication and rich hosting capabilities. Additionally, .NET Framework 4 provides new WCF features such as service discovery, router service, simplified configuration and a number of improvements to queuing, REST support, diagnostics, and performance.
  • Innovative new parallel programming features such as parallel loop support, Task Parallel Library (TPL), Parallel LINQ (PLINQ), and coordination data structures which let developers harness the power of multi-core processors.

Click Here for the Framework 4.0 Beta1 ONLY Download Page… – Check further down if you want both the Framework and Visual Studio.NET 2010 Beta1.

 Note: It should be noted that the 4.0 download size can be anywhere from 76.7MB to 380.5MB, depending on what’s the computers already has installed. .NET 4.0 will be similar to 3.5 in that it will contain full 2.0 and 3.0, and 3.5 support via a single download.

 Visual Studio .NET 2010 Beta1

  If your more interested in Visual Studio then check out Microsoft’s overview and click on the download links below..

Brief Description

Microsoft Visual Studio 2010 and the .NET Framework 4 are the next generation of Microsoft development tools. They work together to accelerate the process of turning vision into reality for the developer. Visual Studio 2010 Professional has been engineered to support the development of applications for Windows, the Web, and Office.


Visual Studio 2010 and the .NET Framework 4 mark the next generation of developer tools from Microsoft. Designed to satisfy the latest requirements of developers, Visual Studio delivers key innovations in the following areas:

Enabling emerging trends

Every year the industry develops new technologies and new trends. With Visual Studio 2010, Microsoft delivers tooling and framework support for the latest innovations in application architecture, development, and deployment.

Inspiring developer delight

Ever since the first release of Visual Studio, Microsoft has set the bar for developer productivity and flexibility. Visual Studio 2010 continues the tradition by significantly improving the experience for all software development roles.

Riding the next generation platform wave

Microsoft continues to invest in the market-leading operating system, productivity applications, and server platforms to deliver increasing customer value. With Visual Studio 2010, customers will have the tooling support that is required to create amazing solutions around these technologies.

For more information about Visual Studio 2010 and the .NET Framework 4, visit the Microsoft Visual Studio 2010 Web site.

Note: Microsoft has setup a couple different ways to download. The first is download via a ‘Web Install’ and the other is a ISO feature via a 2 Part download.

Click Here to goto the Download Page for Web Install…

Click Here to goto the Download Page for the ISO based downloads…

Remember that all of these downloads are considered Beta1 and therefore you should not make use in production based programming. Youcan, and probably will run into some problems, quirks, and even outright errors. If so, it would be helpful to send the info to Microsoft.

Have Fun!


Revised: 2015

Free eBook, and other Free Resources and Source Code

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (16 votes, average: 4.13 out of 5)

Some of these resources could be older and may have been posted on this site before. (Shouldn’t been to many though). Basically everything I post here is Free.

Clinic 6262: Introducing Windows Workflow Foundation using .Net Framework 3.5 & Visual Studio 2008

This clinic will provide a start point for Enterprise Developers and Software Architects that are looking to Windows Workflow Foundation as a solution for enabling business processes within their solutions. Within the clinic you will learn about the functionality provided by the workflow engine, the overall architecture, and how to build workflow enabled applications.

At the end of the course, students will be able to:


  • Describe the WF value proposition
  • – Describe Windows Workflow Foundation
  • – Describe Model driven benefits
  • – Describe how WF increases developer productivity
  • – Describe how WF allows increased collaboration between devs and business analysts
  • – Describe the benefits of OS integration
  • – Describe Scenarios for building WF
  • – Describe Microsoft products that will leverage WF
  • Describe how to build WF applications
  • – WF hosting environments
  • – Workflow Designer
  • – Workflow debugger
  • – XAML
  • Describe the WF architecture
  • – Workflow Runtime
  • – Workflows
  • – Activities
  • – Fault Handling
  • – Communication Activities
  • – Role Activities
  • – Custom Activities
  • New features in .NET 3.5
  • – Integration of workflow (WF) and services (WCF) as Workflow Enabled Services


Click Here to Check it Out!

Windows® API Code Pack for Microsoft® .NET Framework

The Windows® API Code Pack for Microsoft® .NET Framework provides a source code library that can be used to access some new Windows 7 features (and some existing features of older versions of Windows operating system) from managed code. These Windows features are not available to developers today in the .NET Framework.

The individual features supported in this version (v1.0) of the library are:

  • Windows 7 Taskbar Jump Lists, Icon Overlay, Progress Bar, Tabbed Thumbnails, and Thumbnail Toolbars.
  • Windows 7 Libraries, Known Folders, non-file system containers.
  • Windows Shell Search API support, a hierarchy of Shell Namespace entities, and Drag and Drop functionality for Shell Objects.
  • Explorer Browser Control.
  • Shell property system.
  • Windows Vista and Windows 7 Common File Dialogs, including custom controls.
  • Windows Vista and Windows 7 Task Dialogs.
  • Direct3D 11.0, Direct3D 10.1/10.0, DXGI 1.0/1.1, Direct2D 1.0, DirectWrite, Windows Imaging Component (WIC) APIs. (DirectWrite and WIC have partial support)
  • Sensor Platform APIs
  • Extended Linguistic Services APIs
  • Power Management APIs
  • Application Restart and Recovery APIs
  • Network List Manager APIs
  • Command Link control and System defined Shell icons.

 Click Here to Check it out!

 Understanding Microsoft Virtualization Solutions

 Info: This guide will teach you about the benefits of the latest virtualization technologies and how to plan, implement, and manage virtual infrastructure solutions. The technologies covered include: Windows Server 2008 Hyper-V, System Center Virtual Machine Manager 2008, Microsoft Application Virtualization 4.5, Microsoft Enterprise Desktop Virtualization, and Microsoft Virtual Desktop Infrastructure.

If you want the entire eBook they have a link on the same page as the view Chapter 1.

 Click Here to Check it out!

 Collection 6261: Developing Rich Experiences using Microsoft .NET Framework 3.5 & Visual Studio 2008

More Info on the FREE e-Learning Collection…

Can no longer find working links for this specific resource. Sorry

Thats all for now. Sorry about the structure and overall visual of this post. It looks kind of messy and confusing but I hope you can get the info you wanted. Take care!


Free eBook: Patterns & Practices Application Architecture Guide 2.0

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (23 votes, average: 4.35 out of 5)

A while back Microsoft made available a new eBook for free called: Patterns and Pratices Application Architecture Guide 2.0

The download is about 3 megs of info and in the .pdf format. This book is should be very useful and helpful for .NET developers. Below are some of the features and Chapters in the free book.


Part I, Fundamentals
Part II, Design
Part III, Layers
Part IV, Archetypes


  • Foreword by S. Somasegar
  • Foreword by Scott Guthrie


  • Introduction
  • Architecture and Design Solutions At a Glance
  • Fast Track


Part I, Fundamentals

  • Chapter 1 – Fundamentals of Application Architecture
  • Chapter 2 – .NET Platform Overview
  • Chapter 3 – Architecture and Design Guidelines


Part II, Design

  • Chapter 4 – Designing Your Architecture
  • Chapter 5 – Deployment Patterns
  • Chapter 6 – Architectural Styles
  • Chapter 7 – Quality Attributes
  • Chapter 8 – Communication Guidelines


Part III, Layers

  • Chapter 9 – Layers and Tiers
  • Chapter 10 – Presentation Layer Guidelines
  • Chapter 11 – Business Layer Guidelines
  • Chapter 12 – Data Access Layer Guidelines
  • Chapter 13 – Service Layer Guidelines


Part IV, Archetypes

  • Chapter 14 – Application Archetypes
  • Chapter 15 – Web Applications
  • Chapter 16 – Rich Internet Applications (RIA)
  • Chapter 17 – Rich Client Applications
  • Chapter 18 – Services
  • Chapter 19 – Mobile Applications
  • Chapter 20 – Office Business Applications (OBA)
  • Chapter 21 – SharePoint Line-Of-Business (LOB) Applications



  • Cheat Sheet – patterns & practices Pattern Catalog
  • Cheat Sheet – Presentation Technology Matrix
  • Cheat Sheet – Data Access Technology Matrix
  • Cheat Sheet – Workflow Technology Matrix
  • Cheat Sheet – Integration Technology Matrix

As you can see, this book can be very useful and helpful for those programming using the .NET framework. I recommend you download and check it out. Have fun!


Small Basic – Beginner Programming Language

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (11 votes, average: 4.09 out of 5)

Small Basic – New Beginner Programing Language

Microsoft appears to be supporting a somewhat newer programming language called SmallBasic. As the name implies it is not a full-featured language like VB.NET or C++/C#. In fact, it appears to only support 15 or so Keywords. But it does get access to version 3.5 of the Dot .NET Framework from what I have gathered. And looks like it uses alot of the VB based syntax, although C# syntax might be used but I am not sure. There are some game source codes like Tetris and Snake that uses the Small-Basic language. Below are some resources you can check out if your interested. I will also place the main Small Basic link on the Free IDE/Compiler Downloads page when I get time.

MSDN Microsoft Forward Explanation

Small Basic is a project that’s aimed at bringing “fun” back to programming. By providing a small and easy to learn programming language in a friendly and inviting development environment, Small Basic makes programming a breeze. Ideal for kids and adults alike, Small Basic helps beginners take the first step into the wonderful world of programming.

  • Small Basic derives its inspiration from the original BASIC programming language, and is based on the Microsoft .Net platform. It is really small with just 15 keywords and uses minimal concepts to keep the barrier to entry as low as possible.
  • The Small Basic development environment is simple, yet provides powerful modern environment features like Intellisense™ and instant context sensitive help.
  • Small Basic allows third-party libraries to be plugged in with ease, making it possible for the community to extend the experience in fun and interesting ways.

Main Resources Links


Main Small basic DevLabs Page – Click Here


Main Small-Basic MSDN/Microsoft Page – Click Here


Small Basic Program IDE Setup – Click Here


API Reference for Small Basic – Click Here


Small Basic MSDN Forums/Threads – Click Here


PDF for Getting Started – Click Here

Game Examples

Tetris Example: This game is based on Small Basic and uses about 530 lines of code. It looks like a well-done, completed game. Click Here

Snake Game Example: If you are interested in a Snake type game, there is a example that of course uses SmallBasic. Click Here

Thats all for now. If your interested then hopefully this page will help someone to get started in the Windows based programming world… Have Fun!


More Microsoft “How Do I” Video Updates and Service Pack 1 for 2008

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (8 votes, average: 4.00 out of 5)

I just wanted to mention that Microsoft officially launched the RTM version Service Pack 1 for Visual Studio 2008 a couple weeks ago. It includes many fixes and some other features and improvements. WPF (Windows Presentation Foundation) performance has been greatly increased as well. Click Here to check out the Service Pack for VB 2008.

Also Microsoft has been adding new How Do I videos for Visual Basic 2008 the past couple of months it appears. Its definitely worth checking out. It looks like Microsoft added many newer videos working with Excel and Microsoft Office and services. Linq and data-based programming looks to be updated as well. Remember that MSDN has many 2005 based videos as well. Anyways, Click Here if you want to check out the full list of MSDN’s “How Do I” video series. Have Fun!


Advanced Textbox Manipulation in Visual Basic and VB.NET | Part 1 of 2

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (20 votes, average: 3.95 out of 5)

This is the first post in a two part series on how to do add some extra textbox features not exposed in your normal VB or VB.NET textbox. For instance, Page Left/Right and Line Up/Down.

Note: These codes are basically taken from an example I made at my site for VB.NET that shows how to do lots and lots of various textbox based manipulating. Just go to under the Visual Basic.NET – Examples page.

So in Part #1 I will provide code to add six new abilities to a Textbox control…

  • Page Left
  • Page Right
  • Line Left
  • Line Right
  • Left Edge
  • Right Edge

To accomplish these features I will use the tried and true Windows API. Specifically the SendMessage Function.

First is the API function

Visual Basic 6.0

    'Used to Send Messages to the control.
    Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal winHandle As Long, _
        ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Visual Basic.NET, VB 2008 and Visual Basic 2010

    'Used to Send Messages to the control.
    Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal winHandle As Int32, _
        ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32

Now for some Constants…

Visual Basic 6.0

    Private Const EM_SCROLL = &HB5

    Private Const SB_PAGEDOWN = 3

    Private Const SB_PAGEUP = 2

    Private Const SB_LINEUP = 0

    Private Const SB_LINEDOWN = 1

    Private Const SB_BOTTOM = 7

    Private Const SB_TOP = 6

Visual Basic.NET through VB 2008, VB 2010, and newer

    Private Const EM_SCROLL As Int32 = &HB5

    Private Const SB_PAGEDOWN As Int32 = 3

    Private Const SB_PAGEUP As Int32 = 2

    Private Const SB_LINEUP As Int32 = 0

    Private Const SB_LINEDOWN As Int32 = 1

    Private Const SB_BOTTOM As Int32 = 7

    Private Const SB_TOP As Int32 = 6

All that’s really needed is the Textbox you want to manipulate and call Sendmessage with the right combination of constants to perform the intended function.

NOTE: If your using VB 6.0 then change one thing in the rest of the code below…

  • Instead of txtControl.Handle.ToInt32, make it txtControl.hWnd

That’s basically the only change needed.

Page Left / Page Right

        'Move the position pageleft.
        SendMessage txtControl.Handle.ToInt32, WM_HSCROLL, SB_PAGELEFT, 0

        'Move the position pageright.
        SendMessage txtControl.Handle.ToInt32, WM_HSCROLL, SB_PAGERIGHT, 0

Line Left / Line Right

        'Move the position left.
        SendMessage txtControl.Handle.ToInt32, WM_HSCROLL, SB_LINELEFT, 0

        'Move the position right.
        SendMessage txtControl.Handle.ToInt32, WM_HSCROLL, SB_LINERIGHT, 0

Left Edge / Right Edge

        'Move the position to the left edge.
        SendMessage txtControl.Handle.ToInt32, WM_HSCROLL, SB_LEFT, 0

        'Move the position to the right edge.
        SendMessage txtControl.Handle.ToInt32, WM_HSCROLL, SB_RIGHT, 0

As you can see these non-native features were simple to add and configure.

Part #2 will go over:

  1. Page Up
  2. Page Down
  3. Line Up
  4. Line Down
  5. Top Edge
  6. Bottom Edge

Well that’s basically it for this article, Have fun!


Revised: 2014

Sharpening Your Axis with Visual Basic 9 – Code Magazine Article

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 3.50 out of 5)

This is a four (4x) page article on using Linq with XML. The article breaks it down fairly well and shows how to do some pretty cool things using these features. The first page goes over XML Literals and using them with Embedded Expressions. Page two is basically using the XML Axis properties and creating XML Intellisense. Page three goes somewhat deep on using XML Relational Data using LINQ features. The final page goes over more Advance Namespace Scenerioes and provides some Tips and Tricks you can use as well. Anyways, below is a brief overview from the author.

Author Info…

  Visual Basic 9 in Visual Studio 2008 has a new set of language features that allows developers to work with XML in a much more productive way using a new API called LINQ to XML. LINQ stands for Language Integrated Query and it allows you to write queries for things like objects, databases, and XML in a standard way. Visual Basic provides deep support for LINQ to XML through what’s called XML literals and XML axis properties. These features allow you to use a familiar, convenient syntax for working with XML in your Visual Basic code. LINQ to XML is a new, in-memory XML programming API specifically designed to leverage the LINQ framework. Even though you can call the LINQ APIs directly, only Visual Basic allows you to declare XML literals and directly access XML axis properties. This article will help you master these new features for working with XML in Visual Basic.

If your interested in checking out the article then click here to view it.  Have Fun!


How-to Playback Movies and Videos with VB and Visual Basic .NET

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (25 votes, average: 4.12 out of 5)

As you will see, playing videos is easy using the Windows MCI Command interface for the playback which is supported in Windows XP, Windows Vista, Windows 7, Windows 8, and Windows 10. Specifically the MCISendString function will be used in this tutorial.

MCI should by default already support the common formats like avi, mpg, mpeg, wmv, etc. with a basic Windows installation. But you can actually get MCI to playback nearly all formats if the correct Codec/Driver is installed. For Example, you can playback Apple QuickTime .Mov, MPEG 4 DivX, or H.264 .MP4 by simply installing the codec for each format. After that just program the device like you normally would.

This article is only to show how to do basic playback of videos and not features like duration/length, position, or resizing the video. You can check out my MCI MultiMedia Tutorial to learn how to program MCI and add your own features.

If your using VB 6.0 select the correct MCISendString declare below, change any IntPtr.Zero code to 0, and use ‘.hWnd’ instead of ‘.Handle’.

Edit: 2014, December 17th: I decided to make a download available that uses all of the codes in this article with a couple extras to help resizing and such. I also changed some of the code in the program for Option Explicit.

Download Example: Click Here

View Screenshot: Click Here

Visual Basic 6.0 and Older

    'The Main API call that will be used for the playback.
    Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal _
        lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As _
            Long, ByVal hwndCallback As Long) As Long


Visual Basic.NET and Newer

    'The Main API call that will be used for the playback.
    Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal _
        lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As _
            Integer, ByVal hwndCallback As IntPtr) As Integer


OR You Can Use…

    'The main API call.
    <DllImport("winmm.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
    Public Shared Function mciSendString(commandString As String, returnString As String, _
        returnStringLength As Integer, _mciCallback As IntPtr) As Int32
    End Function

Now make a couple variables.

    'Will hold the path to the movie file.
    Dim filename As String

    'Holds the return value of mciSendstring. Not used for anything in this article though.
    Dim retVal As Integer


Then set a path to the file you want to play. If you’ve seen my other MCI articles you should remember about adding “Quotes” around the path and filename, or at least supply the file’s short pathname.

        'The path to the movie or video to play.
        filename = "c:\movies\MyMovieFile.mp4"

        'Now add the quotes around the path.
        filename = Chr(34) & filename & Chr(34)

Next thing to do is open and setup a playback device. I usually use the MPEGVideo device since it works with audio and video. The MPEGVideo device is DirectShow down under.

There are a couple ways you can open the video. You can have it display in its own popup window or have it displayed in a control like a Panel or Frame. Basically any control with a .hWnd or .Handle property.

This command will display open a new device and have the video display in a control window.

'This code below will open a new mpegvideo device and play the movie in the “movieWindow” control which is
'nothing more than a GroupBox/Frame control I used in an example app. Basically any control with a
'handle can be used. For VB 6 you would use the controls .hWnd property instead of the
'Handle.ToInt32 property.
'If you want MCI to select which device to use just take out "type mpegvideo" from the code.

retVal = mciSendString("open " & filename & " type mpegvideo alias myMovie parent " _
& movieWindow.Handle.ToInt32 & " style child", vbNullString, 0, IntPtr.Zero)


If you want the video to open in a separate window use this code instead.

'Specify the mpegvideo driver to play the movies which should play most movie formats without any problems.
'This code will have the video open in its Own window and the alias name will be “myMovie”.
If you want MCI to select which device to use just take out "type mpegvideo" from the code.

retVal = mciSendString("open " & filename & " type mpegvideo alias myMovie", vbNullString, 0, IntPtr.Zero)

OK, now that you’ve opened a device, all you have to do is call the Play command to begin playback. The codes below will Play, Stop, Pause, and Resume.


 'Start Playing the movie once you’ve setup the device with your file.
 retVal = mciSendString("play myMovie", vbNullString, 0, IntPtr.Zero)



'Will Stop the playback if its currently playing.
 retVal = mciSendString("stop myMovie", vbNullString, 0, IntPtr.Zero)



'Will Pause the playback if its playing.
 retVal = mciSendString("pause myMovie", vbNullString, 0, IntPtr.Zero)



'Will Resume the playback if it has been paused.
retVal = mciSendString("resume myMovie", vbNullString, 0, IntPtr.Zero)


You want to use this code when your done with your device and/or closing your program so the mci resources will be cleaned up. You could change ‘close myMovie’ and put ‘close all’ to free everything MCI has used.

        'Will make sure the previous alias is destroyed. If the alias “myMovie” hasn’t been created yet,
        'this code will NOT cause any errors or anything. So there is no need to worry about that.
        retVal = mciSendString("close myMmovie", vbNullString, 0, IntPtr.Zero)

Well, that’s all there is to it. Hope you found something useful from this article. Have Fun!


Revised: 2015

Readymade Options for Playback of Music/Audio Files in VB and VB.NET – 2 of 2

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (21 votes, average: 3.81 out of 5)

I finally got time to finish part two about options available to play audio or music files using Visual Basic 6.0 and Visual Basic .NET. This article will provide info on two 3rd Party libraries for audio playback with advanced features. They are both feature rich and provide many  advanced features. The first is the Bass.Dll Sound System and the second is the FMod.dll Sound System.

Both libraries are Free to use as long as the application’s using them are not commercial or compensated. If its a personal or freeware application they grant you a free license to use them. Bass.dll does have a lower cost option if your making a Shareware app. You should read through the license agreements of each library before using them in your applications.

Note: You can check out part one at this link.

 BASS.DLL Audio System Library

This is a great library for pretty much all of your music or audio needs. Bass can play everything from mp3’s, wave’s and mod music to .cda’s and internet streaming. It has alot of source code and examples for Visual Basic and Visual Basic.NET. This library gives you access to the samples that are playing so you can plot your own visualizations or ffts. I had alot of experience with this library a few years ago and even made the original VB.NET api and examples for the author. The .dll is very small in size (Under 100KB) so it won’t bloat your application.

Author Information: BASS is an audio library for use in Windows and Mac OSX software. Its purpose is to provide developers with powerful and efficient sample, stream (MP3, MP2, MP1, OGG, WAV, AIFF, custom generated, and more via add-ons), MOD music (XM, IT, S3M, MOD, MTM, UMX), MO3 music (MP3/OGG compressed MODs), and recording functions. All in a tiny DLL, under 100KB* in size.

On Windows, BASS requires DirectX 3 or above for output, and takes advantage of DirectSound and DirectSound3D hardware accelerated drivers, when available. On OSX, BASS uses CoreAudio for output, and OSX 10.3 or above is recommended. Both PowerPC and Intel Macs are supported.

C/C++, Delphi, Visual Basic, and MASM APIs are provided, with several examples to get you started. .Net and other APIs are also available.

 Main Features Main features
Support for WAV/AIFF/MP3/MP2/MP1/OGG and custom generated samples
Sample streams
Stream any sample data in 8/16/32 bit, with both “push” and “pull” systems
File streams
MP3/MP2/MP1/OGG/WAV/AIFF file streaming
Internet file streaming
Stream data from HTTP and FTP servers (inc. Shoutcast, Icecast & Icecast2), with proxy server support and adjustable buffering
Custom file streaming
Stream data from anywhere using any delivery method, with both “push” and “pull” systems
Multi-channel streaming
Support for more than plain stereo, including multi-channel OGG/WAV/AIFF files
MOD music
Uses the same engine as XMPlay (very accurate, efficient, high quality reproduction), with full support for all effects, filters, stereo samples, DMO effects, etc…
MO3 music
MODs with MP3 or OGG compressed samples (vastly reduced file size with virtually identical sound quality), MO3s are created using the MO3 encoder
Multiple outputs
Simultaneously use multiple soundcards, and move channels between them
Flexible recording system, with multiple device support and input selection, (WMA encoding & broadcasting via the add-on, and other formats via BASSenc)
Decode without playback
Streams and MOD musics can be outputted in any way you want (encoded, written to disk, streamed across a network, etc…)
Speaker assignment
Assign streams and MOD musics to specific speakers to take advantage of hardware capable of more than plain stereo (up to 4 separate stereo outputs with a 7.1 soundcard)
High precision synchronization
Synchronize events in your software to the streams and MOD musics, synchronize playback of multiple channels together
Custom DSP
Apply any effects that you want, in any order you want
DirectX 8 effects Windows only
Chorus / compressor / distortion / echo / flanger / gargle / parametric eq / reverb, 2 implementation options each with its benefits (including mixing with DSP functions)
32 bit floating-point decoding and processing
Floating-point decoding/rendering, DSP, FX, and recording
3D sound
Play samples/streams/musics in any 3D position, with EAX support
Small buffers for realtime performance, large buffers for stability, automatic and manual buffer updating, configurable threading
Add-on system for additional format support and effects (C/C++ API available on request), dynamic plugin loading system, access to underlying DirectSound objects
BASS is less than 100KB*, so won’t bloat your distribution

As you can see, this is a very feature-rich and flexible sound system. If your interested in Bass.dll then go to the main webpage.

FMOD.dll Music and Sound Effects System

Continue reading

How to Playback a Audio Compact Disk (Play/Stop/Pause a CD) using VB and VB.NET

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (10 votes, average: 4.10 out of 5)

Thankfully playing audio based .cda cds is an easy process and does not require having to rely on 3rd party controls. You can simply use the Microsoft Windows MCI Command Interface to do this. As you may be aware of you can do almost all of your Media based playback needs by using this interface including playing movie files. I do plan on making a new article on playing movie files in the future. I have a complete tutorial with some source code on how to use and program the mciSendString API so you can get a much deeper understanding on how it works and how to use it. Click on this link if you want to read it.

To get started you first need to setup the main API call that is required. Simply add the API below to your declarations section…


Visual Basic 5.0/6.0….

'Api call to send the commands to the mci device
Private Declare Function mciSendString Lib “winmm.dll” Alias “mciSendStringA” (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

Visual Basic .NET…

'Api call to send the commands to the mci device
Private Declare Function mciSendString Lib “winmm.dll” Alias “mciSendStringA” (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer


Now that the main API call is setup and declared you need to start using it to program the device and send it commands. The first thing you need to do is create a new device and set the device to use the CDAudio driver. As you may have guessed this driver will do AudioCD playback. Below is how to create a new device using the CDAudio driver.

Note: In this article if your using VB 5/6 you only need to change Integer or Int32 types to Long types.


'This will hold the mci return value. The value in this variable will not be used in this article however.
Dim retVal As Integer
'This will be used to specify the drive letter of the CD or DVDRom drive to use.
Dim cdDrive As String
'This should be set to the CD or DVD drive your Music CD is in.
cdDrive = "D:\"
'Add quotes which will keep from having to get the short path since the mci device could fail if using the normal long file and path. Remember to set cdDrive to the CDRom or DVDRom optical drive. Specify like: D: or D:\ if D is your drive, or E: or E:\ and so on.
cdDrive = Chr(34) & cdDrive & Chr(34)
'Create a new CDAudio device with the alias CD. “CD” is how we will refer to the device  in this program.
retVal = mciSendString(“open “ & cdDrive & ” type cdaudio alias cd wait shareable”, vbNullString, 0, 0)
'Send the command to set the time format to the device default. Set this so when asking for time/track information we can get the value as a Tracks/Minutes/Seconds/Frames format.
retVal = mciSendString(“set cd time format tmsf”, vbNullString, 0, 0)


Now that a device has been created to use the CDAudio driver its time to start sending some commands.


The code below will return the total number of tracks on the audio cd in the cd drive…

'This variable is used to receive the value when requesting information from the mci device.
Dim buf As String
'Give it a 128 space buffer.
buf = Space(128)
'This will get the total number of tracks returned from the device.
Dim trackCount As Integer

retVal = mciSendString(“status cd number of tracks”, buf, 128, 0)
'Get the integer value from the buffer. It will return 0 (zero)  if no tracks are detected or if no audio cd is present.
trackCount = CInt(Val(buf))


If trackCount has the number 12 then there are 12 tracks starting at Track #1 through to Track #12. So when referring to a specific track you need to specify the exact number you want the information from.

Next you can now go ahead and start Playing, Stopping, and Pausing/Resuming a Audio CD’s tracks. First you want to tell the device which track you want to play. The next set of codes will do that.


'This will hold the track number to play. It is then set to track 2 below.
Dim trackToPlay As Integer
'Set to play Track number 2 on the compact disk.
trackToPlay = 2
'You need to set the time format to the cd devices default so it knows that 1, 2, 3, 4, and so on is the track number.
'Set the time format to the cd devices default Tracks, Minutes, Seconds, Frames when you are wanting to seek to a specific track.
retVal = mciSendString(“set cd time format tmsf”, vbNullString, 0, 0)
'This will tell the device to move to the track number specified. Simply put in the track number you want to play.
retVal = mciSendString(“seek cd to “ & trackToPlay, vbNullString, 0, 0)


You can now start Playing, Stopping, Pausing, and whatever it is you want to do.


'Start playing the cd at the track you already specified above.
retVal = mciSendString(“play cd”, vbNullString, 0, 0)
'Stop the cd from playing.
retVal = mciSendString(“stop cd”, vbNullString, 0, 0)
'Will pause the CD if its playing.
retVal = mciSendString(“pause cd”, vbNullString, 0, 0)
'Resumes the cd to playing if it was paused.
retVal = mciSendString(“resume cd”, vbNullString, 0, 0)


Thats ALL there is to it! IF the codes in this article was properly implemented then it should Start, Stop, Pause, and Resume an Audio Compact Disk (CD). There is MUCH more you can do with Audio CD’s as well like getting the length, position, fast forward, Opening/Closing the CD Door and so on. But some of those features might be implemented in a future article.

I suggest you really go check out my MCI Command tutorial this site, or an older revision but downloadable .doc version so you can try and learn how to actually implement your own custom functionality and possibly checking out the documentation at

If you don’t care or have the time to create your own source code for audio CD based playback then you can check out my AudioCD based class libraries. My website has MANY libraries available that greatly simplifies the task of creating a CD player based application. I even recently released a brand new library named csAudioCD Library v2.5 Pro Enhanced for Visual Basic 2005 and VB 2008 that has Over 50 subs and properties. I have libraries for VB.NET 02/03 and VB 5.0/6.0 as well. I suggest you goto my main website under the controls and examples section if your interested. There are example applications available as well on how to use the audio cd libraries.

Anyways, I hope you got something useful from this article and it was easy to understand as well. Sometime in the future I may expand on this subject by showing how to get position, duration based information and such. Have Fun!


Extract the Associated Icon from a File Easily using VB 2008/2010

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (14 votes, average: 4.21 out of 5)

Microsoft added a new feature in Visual Basic 2005 (and is present in 08 as well) that will very easily get the icon associated with a specified file. In the past you would have to use the Windows APIs to extract a icon from a file. But now you can use a feature in Version 2.0 and higher of the DotNET Framework to perform this task which is what this little tip will show.

The function to use is ‘ExtractAssociatedIcon’ that is located under the System.Drawing.Icon namespace.

Public Shared Function ExtractAssociatedIcon(ByVal filePath As String) As System.Drawing.Icon

As you can see this is a very simple function. All you need to do is specify the path of the file whose icon you want to extract and handle the return value of the function which is the Icon associated with the file specified in the filePath parameter.

The code below will get the Icon associated with the file I specified and display the Icon in a Picturebox control.

picSource.Image = Drawing.Icon.ExtractAssociatedIcon(“pathAndFileToGetIcon”).ToBitmap()

Using the code above, i’m using a picturebox that I named picSource while converting the Icon to a Bitmap which can then be displayed easier in the picturebox image property. IF you want to save the icon image displayed in the picturebox control, the small piece of code below will do the trick.


Well, thats all there is to it I guess. Since MS added this ‘ExtractAssociatedIcon’ Function to the framework you no longer have to use the APIs to get similar results if your using Visual Basic .NET 2005 or version 2008. Have Fun!


How to Open a Url or Link in Default WebBrowser – VB 6.0

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (10 votes, average: 3.80 out of 5)

I figured this would be very easy to do since VB has a Shell command built-in. But I would keep getting a File not Found message everytime I would try and open a web address. It would work for other tasks like shelling “shutdown -r -f -t 0” which is a process that can be be used to shutdown or restart the computer, but not opening a URL. So I decided to go ahead and use the Windows APIs to do this task. Below is the API Call and codes to open a url in the default web browser.


This Function will be used to process the url which will have windows open the web browser pointing to that url path.

    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As _
        Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Now all thats needed is to execute that function passing the url you want opened in the third parameter. For this task the 3rd parameter is the most important. Well, I guess 2, 3, 6 should be set. Parameter #2 is how to process the task in the 3rd parameter which will be set to “open”. You could just put a blank string like “” which will still open the url. But just enter “open” to be on the safe side. Parameter #6 is the window style to open the application. Like 1 is for normal and such. As far as I know the other paramters is not required for this to work so I just set them to 0 or vbnullstring.

        'In the last parameter you can specify the program window style.
        '0 = Hide, 1 = Normal, 2 = Minimize, or 3 = Maximize.
        'For other styles just open the VB API Viewer application under your VB's Tools directory and open the Win32Api.txt file and check out the constants that starts with "SW" like SW_NORMAL.
        'Anyways, this will have the Windows Shell open the Default WebBrowser with the url specified in the 3rd parameter.
        ShellExecute 0, "open", "", vbNullString, vbNullString, 1


I added the next codes just to show how to open another program and pass arguments to the program. This code will launch the FireFox webbrowser and open the URL in the 4th parameter.


        'This simply shows how to open a specific program like Firefox which may not be the default webbrowser
        'and how to get it to go to a specific url.
        ShellExecute 0, "open", "C:\Program Files\Mozilla Firefox\Firefox.exe", "", vbNullString, 1



Thats all there is to it!. As you can see with a simple API call you can get the job done. Anyways, have fun!


Use Custom MY.MySettings to Remember an Applications Size and Position in VB .NET

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (7 votes, average: 2.71 out of 5)

Note:  This article is aimed at the Visual Basic .NET 2005/VB 2008 and Newer versions since the earlier versions of dot net do Not have the My feature. But the principals still apply if your using an older version of

This small tutorial is to show you how you can create your own properties using the ‘My.MySettings’ Class. This article will focus on adding Two new properties/settings called: ApplicationSize and ApplicationPosition. I will use them to store the applications position and Size when it exits or closes. Then the next time the application/program loads, it will use these settings and remember the exact Position and Size from the last time it was opened and closed.


Once you have your project loaded, goto the ‘Project’ menu and select the ‘Properties’ option from the list, which is usually the last item listed. Then select the “Settings” Tab item. You will then see the settings grid which is used to configure the application settings.

Name: This is where you put the name of your property/setting. For this tutorial, put in ApplicationPosition as a name, and ApplicationSize as another name. ApplicationSetting and ApplicationSize will actually be listed under: My.MySettings.Default.

Type: Here you can select the type you want your setting/property to be. Example: Point, Size, Date, Integer, and so on. For the article, set the type for ApplicationPosition to be: ‘Point’. For the ApplicationSize set to be the: ‘Size’ type.

Scope: This is where you can specify if the property/setting can only be modified by your Application, or if the person using your application can change the setting. If ‘Application’ is set, then the user cannot modify the setting at runtime. If ‘User’ is selected, then the setting Can be modified at runtime by the user. If you want to have certain preferences that the user can modify, then ‘User’ is the scope you want to use. For the article I went ahead and set it to ‘User’.

Value: You can specify a default value for the property/setting that will be used if the property is being used for the first time or no other value have been specified at runtime. This value will also be used if you ‘Reset’ the properties. Example: My.MySettings.Default.Reset() will reset the settings to your original values.


If you are following the article as a exercise, then your Project Properties should look similar to the picture below (IF you can read it that is…


Under the: My.Settings.Default interface, you should have: My.MySettings.Default.ApplicationPosition and My.MySettings.Default.ApplicationSize available as properties that can now be used. To get your application to use these properties and enable it to remember the size and position to load, you will want to put a few lines of code in the Form_Load event, and the Form_FormClosing event.


Form_Load Event put:

        Me.Location = My.MySettings.Default.ApplicationPosition

        Me.Size = My.MySettings.Default.ApplicationSize

Form_FormClosing Event put:

        My.MySettings.Default.ApplicationPosition = Me.Location

        My.MySettings.Default.ApplicationSize = Me.Size


That’s all there is to it. Now your application will have the ability to memorize the position and size when it was previously ran and can load in the same position and at the same size. You do NOT need to specifically use the registry or create a ini file to enable these user-friendly capabilities.

    There ARE more features and properties available for creating custom properties/settings, but those will have to be covered in a future article. Hope you got something worthwhile from this small tutorial 🙂

    Click Here for a example application with this article.


Check if a File or Folder/Directory Exists in Visual Basic 6.0

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 3.40 out of 5)

There could be a time when you need to check a file or folder exists or not. There are actually a different ways to accomplish this task. You could use the Dir Function located in the FileSystem Class, the Windows API, or the FileSystemObject located in the Windows Scripting Host Object Model. I will show how to use the Dir method and the FileSystem Scripting Object to check if a folder/file exits or not.

Using the DIR Function…

This feature is accessible from the VB 6.0 Runtime, so you don’t need to add any references or components. In my experience this method works just fine, but there could be a scenario that it may not work properly for you.

You simply call the Dir function with the path of the file or directory in the parameter. If the functions returns nothing then its not seeing the path you specified and thus the file or directory does not exist.

    If Dir("c:\myFile.txt") <> "" Then

        MsgBox "It Exists!"


        MsgBox "No Go!"

    End If

That’s all there is to it. As I said, I do not know how this method would work in every scenario, but I’ve seen no problems yet.

Using the Scripting FileSystemObject

This method is not part of the VB 6.0 runtime. So you will first want to go to the Project menu and click on the References item. Once all of the objects are displayed scroll down till you see – “Windows Script Host Object Model”, checkmark it then click OK.

Next you need to create an instance of the FileSystemObject you just referenced.

    Dim f As FileSystemObject

    Set f = New FileSystemObject

Now you just need to call the available FileExists and FolderExists Functions while passing the path for the file and the path for the directory you want to check.

    MsgBox f.FileExists("c:\myFile.txt")

    MsgBox f.FolderExists("c:\")

Depending on whether the file or folder path you specified exits or not the messagebox should have thrown a True or False message.

That’s all there is to it for checking whether a file exists or if a folder/directory exists. The FileSystemObject method is more elegant and maybe more reliable than using the Dir Function but at the cost of having to add a Reference to the Windows Scripting Object which is not apart of the Visual Basic 6.0 Runtime Library. The Dir method still seems to work ok for me. Both ways appear to be case in-sensitive so you won’t have to worry about the letter casing being exact. IF you know of some other ways please feel free to leave a message with the way you do it. Anyways, Have Fun!


Revisited: 2015

New Website Content – Added/Available (Updated!)

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 3.00 out of 5)

This post is now Obsolete.

You may have or may not have noticed a few page links at the top of each page. These pages were to provide more static based information. These pages will continue to change and grow as more information or new information is found.

  Quick Update: I wanted to mention as well that a few weeks ago Microsoft released the Visual Basic 9.0 Language Specification 9.0 document. If you’ve wanted to know the Visual Basic language inside and out, then download and check out this huge document. You may be surprised at some coding techniques you could be using… Click here to goto the msdn download page… I may add this resource to a static page in the future.

FREE IDE Downloads – This page contains a small list of some available IDEs related to Visual Basic and/or Visual Basic.NET based programming. The programs listed should all be completely free of charge.

Service Pack Downloads – This page contains a list of all of the current service pack downloads related to Visual Basic and Visual Basic.NET. Only the latest versions will be listed here.

Utility Downloads – This is the newest page I added and contains a list of programs/utilities that I use on a somewhat regular basis. The page contains both programming and non-programming related programs that are Free of charge.

VB For Beginners – This page was mainly added for those who are basically very new to Visual Basic and Visual Basic.NET based programming. The page main contain both website listed tutorials or downloadable based tutorials like E-Books.

Hopefully you will like the new content being made available to the site. As time goes on the pages should be updated with new content. I will try to remember to list new content related to each of the pages when I find something new or something I forgot about.

Anyways, Have Fun!


How to add Auto Complete to Textbox or Combobox Controls in Visual Basic 2005/2008, VB.NET 2010, and newer

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (6 votes, average: 2.83 out of 5)

Note: This is an article which was taken from my website and is quite old. So take that into consideration… 🙂

As you will see, adding Auto-Complete support to textbox and combobox controls has NEVER been easier than it is now in Visual Basic.NET 2005. No longer do you HAVE to use the Windows API’s to get the Auto Complete functionality.

I will assume you already have a ‘Windows Application’ based project open. You can go ahead and add a textbox control or combobox control to the form. Select the textbox and goto the properties window. (I will assume you added a textbox, but the process is the same for a combobox also. I will just refer to textbox instead of combobox.)

There are 3x properties that relate to the ‘Auto Complete’ feature. You have “AutoCompleteCustomSource”, “AutoCompleteMode” and “AutoCompleteSource”. AutoCompleteCustomSource is exactly how it sounds. You can have your own text that you want the user to be able to use when they are typing in the control. But, I am not interested in going over that property right now though. There is really nothing more to it than what I already said. 🙂

OK, the “AutoCompleteMode” property is simply how the AutoComplete text responds. Click on the “AutoCompleteMode” property and then open the dropDown list associated with it. You will see 4x ‘modes’ available. “None, “Suggest”, “Append”, and “SuggestAppend”. This property MUST be selected either “Append”, “Suggest”, or “SuggestAppend” for the AutoComplete feature to work. If you select “Suggest” mode, then ‘AutoComplete’ will display a list that matches the text that has been typed thus far that you can scroll through and choose from. If you select “Append” mode, then as you are typing, it will automatically highlight the closest match to the text thus far in the textbox/combobox control, usually in alphabetical order. Plus, while you are typing, you CAN use the ‘Up/Down’ buttons on the keyboard to scroll through the list of text that is similar to the text that was typed in the textbox control. The “SuggestAppend” mode, is of course the combination of the other 2x modes. As you are typing the text, it will highlight the first occurance of matching text while also displaying a list of all the text that matches what has been typed in the control.

The “AutoCompleteSource” property is exactly how it sounds. It is the location on the computer system to get the ‘AutoComplete’ list from. Click on that property and then click on the box to dropdown the enumerator values that are available as the source. Available values, at least on my computer are: “FileSystem”, “HistoryList”, “RecentlyUsedList”, “AllUrl”, “AllSystemSources”, “FileSystemDirectories”, “CustomSource”. Just like the “AutoCompleteMode” property, you MUST select one of these values for you to get ‘AutoComplete’ functionality. Since all of the values are self-explanatory, I will not go over them.

Just to test out the ‘AutoComplete’ feature. With a textbox control, (Or Combobox), click on the “AutoCompleteMode” property and select the “Suggest” mode. Then click on the “AutoCompleteSource” property and then select “AllUrl” as the source. Run the project, start typing in the textbox ‘www’ and you should see a list of url’s you’ve visited that start with ‘www’ popup. You can then click on one of the urls and it will put that url text in the textbox.

And thats ALL there is to it! Enjoy!



Adding Custom Tooltips for Visual Basic .NET

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 4.00 out of 5)

This is a very old article but decided to repost it for beginners of .NET coming from VB 6.0.

In Visual Basic 6.0 we had a simple Tooltip property for the controls. All you needed to do was supply the text you wanted to be shown. While Visual Basic.NET did remove that property, you didn’t really have control over the toolTips in general with VB 6.0. For instance, you couldn’t set the delay time, duration, balloon style, and so on.

Now with VB.NET there is a Tooltip component that is more advanced than the VB 6.0 feature. It is very simple to implement and you have more control on how your tooltips will react and display. For example, you can now set the length of time the pointer must remain stationary within the area or region before the text will appear.

To get started simply open a project. In your Toolbox look for a ToolTip component. If you do not see one right click inside your toolbox and select “Customize Toolbox”. Click the “.NET Frameworks Components” tab, scroll down till you find “ToolTip”, then check the box and press OK. You should now see a ToolTip component available. Double click the ToolTip to add it to your project. I just renamed mine toolTip. If you look at the properties available for the ToolTip you will see: Automatic Delay, Initial Delay, and so on. I will not go over any of these settings since they are pretty much self-explanatory. Go ahead and add a button to the form. I named mine btn. Then in the Btn_MouseHover event put:

toolTip.SetToolTip(btn, "Hello, This is just a simple test....")

Start your project and place your mouse pointer within the button region and let it sit idle for a few moments. You should then see the ToolTip balloon popup with the text you specified.

You can also go to the ‘btn’ Button’s property window. You will see a property named: “tooltip on ToolTip”. You can put the text you want displayed for that control and and the text will be displayed and controlled by the properties specified in your ToolTip component without you needing to execute any toolTip code yourself.

So in the end you have more control with your tooltips in .NET. You can make the tips look more balloon like, display longer, delay longer, and so on. Have fun!


More FREE ‘How Do I’ Video Examples from Microsoft

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 3.25 out of 5)

Microsoft is doing a good job of helping people to learn their programming languages. They have recently added 48 New Videos for Visual Basic .NET. The videos appear to be based around VB 2005, and VB.NET 2008. There are a few that is for Visual Basic 2008 Only as well.

Below is a quick overview of each Video Series…


Language Integrated Query (LINQ) Series

This how-to video series is focused on the new LINQ language features of Visual Basic 9.0 included in Visual Studio 2008. LINQ stands for Language Integrated Query, and it enables you to write queries over things like objects, databases, and XML in a standard way using new language syntax. Learn how to use this productive new language feature in your Visual Basic programs.

Forms over Data Video Series

This how-to video series is dedicated to getting Visual Basic developers productive on areas of data-based Windows Application development. The series starts with the basics of database development with SQL-Server 2005 Express then walks through the details of connecting to and querying databases, Windows Forms development basics, Reporting, and Deployment using Visual Basic 2005.

Visual Basic 2008 Forms over Data Videos

These videos continue our series on data-based Windows Application development, now for Visual Basic 2008. Most of the previous 2005 videos are the same experience in Visual Basic 2008, but these videos will highlight the differences and new capabilities.

Windows Development Video Series

In this how-to video series Visual Basic developers will learn additional techniques on how to program .NET applications on the Windows platform.

Office Development Video Series

In this how-to video series Visual Basic developers will learn about the premiere development tools for building Office Business Applications.

Object Binding Video Series

This how-to video series is focused on more advanced data binding techniques using object binding in Visual Basic 2005. The series walks through creating business objects and how to associate them in one-to-many relationships, how to provide searching capabilities and how to enable sorting.

Visual Basic Interop Video Series

This how-to video series is focused on the Interop Forms Toolkit and working with Visual Basic .NET and Visual Basic 6 together. The Interop Forms Toolkit allows Visual Basic developers to migrate their Visual Basic 6 applications over to .NET using a phased migration strategy. Instead of having to convert the entire VB6 application at once, the toolkit enables .NET Forms and User Controls to run directly in Visual Basic 6 applications so that you can build the pieces that you need over time.

Security Video Series

In this how-to video series Visual Basic developers will explore a variety of security questions, including encryption, handling attacks, security best practices, and a lot more.

As you can see these videos covers a broad range of subjects. Some of the videos are related to programming with Linq, Database, Building Reports, Creating Templates, ClickOnce Deployment, Excel, Sharepoint, Power Point, Excel Web Services, Object Binding, Interoping and Deploying Hybrid based Applications, Various Security Videos for setting up Digital Signatures, Clinet Credentials, and many more!

There is bound to be a video or 2 that you would find interesting. The videos are based on the Novice and Professional Programmer. They are adding new videos on a regular basis as well. So they want you to check back once in a while. They claim that there are 48 new Videos since the March update.

So, if your interested in any of these videos, then simply click this link to the main video page. Have fun!


Textbox Scroll to Bottom or Top – Part 2 using VB 6.0 and VB.NET

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (21 votes, average: 2.62 out of 5)

I have a previous post on how to scroll the textbox controls contents to the bottom and the top that many visitors didn’t appear to like. It has a 1.5 rating out of 10 so, it is not liked very much. I really don’t know why because the code seems to work fine. Maybe because the cursor position would be moved? This new code won’t move the actual cursor if thats the case. But anyways, I decided to post another way to scroll the textbox contents by using the Windows API. This method uses the SendMEssage function and passes a couple constants to perform the up and down scrolling process. Below are the codes for VB 6.0 and VB.NET.


Visual Basic 6.0 Declarations…

    'Used to Send Messages to the control and will be used with a request for the current line number in the textbox control.
    Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal winHandle As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    'Constants used for the SendMessage API call function.
    Private Const EM_SCROLL = &HB5
    Private Const SB_BOTTOM = 7
    Private Const SB_TOP = 6




Visual Basic .NET Declarations…

    'Used to Send Messages to the control and will be used with a request for the current line number in the textbox control.
    Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal winHandle As _Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32
    'Constants used for the SendMessage API call function.
    Private Const EM_SCROLL = &HB5
    Private Const SB_BOTTOM = 7
    Private Const SB_TOP = 6


Now all thats left is to setup and call the SendMessage API function…

The first parameter of the SendMessage call is the handle to your textbox control that you want to use.

The second parameter is to let the api know we want to perform some type of scroll action on the control.

The third parameter is the type of scroll to perform on the control.

The fourth parameter is Not used in this example.


Visual Basic 5.0, 6.0 – Scroll the Textbox to the Bottom/Top…

        'This will make the textbox scroll to the bottom without moving the cusor position.
        SendMessage TextBox1.hWnd, EM_SCROLL, SB_BOTTOM, 0
        'The will make the textbox scroll to the top without moving the cursor.
        SendMessage TextBox1.hWnd, EM_SCROLL, SB_TOP, 0

Visual Basic.NET – Scroll the Textbox to the Bottom/Top…


        'This will make the textbox scroll to the bottom without moving the cusor.
        SendMessage(TextBox1.Handle.ToInt32, EM_SCROLL, SB_BOTTOM, 0)
        'The will make the textbox scroll to the top without moving the cursor.
        SendMessage(TextBox1.Handle.ToInt32, EM_SCROLL, SB_TOP, 0)



Alright, those codes above should have moved your textbox control contents down to the bottom and up to the top. Also the cursors position will Not be moved like the other method would do. Hopefully this post will be liked alittle better. If not, then I don’t know what else you want and give up… 🙂


How to Open and Close the CDRom/DVDRom Tray Door using VB and VB.NET

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (18 votes, average: 4.00 out of 5)

Opening or closing the optical disk drive(ODD) tray door in any Visual Basic and Visual Basic.NET language is easy to do thanks to the Windows API. This article will be using code based on the MCISendString Api which I made a complete tutorial for starting MCI. Click this link to check it out.

These codes are setup for VB.NET but all you have to do is change Integers to Longs which will then work pefectly fine with Visual Basic 6.0.

So the first thing you’ll want is this API call…


    'Api call to send the commands to the mci device
    Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As _
        String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As _
        Integer) As Integer

VB 6.0

    'Api call to send the commands to the mci device
    Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As _
        String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As _
        Long) As Long


Now just need to send the commands.

The code below will open and close the default CD/DVD Door and you won’t need to set/specify the ODD drive path.

'Pop it open
mciSendString("set cdaudio door open", 0, 0, 0)

'Shut it
mciSendString("set cdaudio door closed", 0, 0, 0)



Use the codes below will setup and use the variables and the specified alias you want to use.

        'This will simply get the api call return value that can be used if you use the MCIGetErrorString API.
        'This example won’t be using that API though.
        Dim retVal As Integer

        'This will contain the drive you want to open. Ex: D:\ or E:\ or whatever.
        Dim cdDrive As String
        'Now setup the path to your computers cd or dvd drive you want to open or close.

        'Remember to put Quotes around any path you pass to the mci device.
        'Also specify the correct drive letter for the CD/DVD Drive.
        'I’m using drive “D:” which is the location of the DVD/CDRom on my computer.
        'You can specify the drive path like ‘D:’ or ‘D:\’
        cdDrive = Chr(34) & "d:" & Chr(34)

        'Now its time to setup the MCI Device using the CDAudio driver.

        'First setup a new device using the CDAudio driver with alias named “cd”.
        retVal = mciSendString("open " & cdDrive & " type cdaudio alias cd wait shareable", 0, 0, 0)

        'Now that the MCI Device is programmed and ready to go, you can start sending it commands.
        'The codes below will Open the CD or DVD Tray Door and Close the CD/DVD Door…

        'This will Open the door.
        retVal = mciSendString("set cd door open", 0, 0, 0)

        'This will Close the door.
        retVal = mciSendString("set cd door closed", 0, 0, 0)

Thats all there is to it! If the code executed properly, your optical drive should have opened and/or closed. The code here will work with all VBs and VB.NET languages.

Just Change all Integer types to Long types if your using VB 6.0.

If your wanting to make a complete CD Player application, I have complete libraries for both VB 5/6 and Visual Basic.NET at my Visual Basic Code Source website. Anyways, have fun!