Adding Time

It first brakes the two numbers, the two numbers you want to add into hours, minutes and seconds. Then It adds them together (each part by its own), it makes sure that the result is two characters, because if you add 2 and 2 VB will consider it as 4 and not as 04. After … Continue reading Adding Time

Adding Items To the ControlBox Menu

The following code will add an "About" menu item. Declare: Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As String) As LongDeclare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As LongDeclare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" … Continue reading Adding Items To the ControlBox Menu

Add Popup Menus To TreeView Controls

The problem is that the TreeView control does not support right click menus. There is no easy way to tell what mouse button was pushed to cause a NodeClick event. The code below, when used in a TreeView MouseUp event, will capture the specific node that a right mouse button is clicked on, allowing you … Continue reading Add Popup Menus To TreeView Controls

ActiveX DLL's/OCX's And Long File Names

Where I work we designed our application (VB5 and C++) and used long file names for our DLL's and OCX's. For some unexplained reason we had trouble with the files after registering them in the Registration Database. We switched to the old 8.3 file names and the problem went away. I could not find any … Continue reading ActiveX DLL's/OCX's And Long File Names

Activate Currently Running Instance

If App.PrevInstance Then     AppActivate "MyApp Version 1.0"     EndEnd If   This tip is reprinted from the VB Tips & Tricks Volume 1 book.

Accessing The Registration Database Via The API

In another article, Bradley S Murray detailed how to enter information into the Registration Database via a temporary file. While this method works, it does feel a little kludgy. I have written some demo code to show you how to add, query, amend and delete entries in the Registry via the API calls contained in … Continue reading Accessing The Registration Database Via The API

Accessing Secured Databases from VB4

Also, an apparent bug in the 16-bit Jet 2.5 database engine causes the DBEngine's CreateWorkspace method to fail unless the DefaultUser and DefaultPassword properties contain the values required by the secured database. And so, for your coding pleasure, I'm is pleased to present the following examples: For 16-bit programs, you must first create an APPNAME.INI … Continue reading Accessing Secured Databases from VB4

3D Forms & Controls Without Using A VBX

Do you want to make your controls and forms have that 3D look without adding the overhead of a VBX? Well, it's easy to do with just Windows API calls. As a matter of fact, the VBX's you shell out money for are just "wrappers" to those same API calls. With the PAINT3D.BAS module that … Continue reading 3D Forms & Controls Without Using A VBX

Visual Basic at 10 Years Old

Wow, Visual Basic is ten years old and counting! A milestone like this makes me want to reflect to when I started using VB and happened in my life since then. I've been asked more than once how I got started using VB, and now I've been given the opportunity to write it down for … Continue reading Visual Basic at 10 Years Old