UserControls

UserControls

Why a UserControl? What is a UserControl? How do I use these UserControls?

MHAssociate

This control will associate a file extension with a program. It includes Open and Print command associations, plus Description and DefaultIcon properties. For those of you familiar with this control in its previous shareware form, I've added a DrawAssociatedIcon function that will show you the icon you've selected. The sample includes previous/next buttons that browse through a file's icons. Added CreateCommand method that gives you the ability to add commands that will appear when the file is right-clicked from Explorer.
Compiled sample application (VB5 run-time module required)
Download the MHAssociate control (subscribers only)
View a screenshot

MHBmp

This control is a user-defined transparent picture. You can easily extend its functionality using the ActiveX Control Interface Wizard. It allows you to load (or draw) pictures and define transparency as a specific color.
Compiled sample application (VB6 run-time module required)
Download the MHBmp control (subscribers only)
View a screenshot

MHBrowse

This control implements the standard browsing window. You can browse for folders, printers, or computers. You can specify a start directory or start inside a special folder like the Desktop or Recycle Bin.
Compiled sample application (VB5 run-time module required)
Download the MHBrowse control (subscribers only)
View a screenshot

MHColorPicker

This control gives you an RGB color picker and calculates the HLS value (hue, lightness, saturation).
Compiled sample application (VB6 run-time module required)
Download the MHColorPicker control (subscribers only)
View a screenshot

MHDialogMagic

Modify the Common Dialogs to indicate the real purpose - change Open to Load or Select. Change any displayed text, including the dialog title and buttons, to whatever you want. Also has three simple methods for changing Open to Load or Select, or Save As to Save. You can also enumerate the text items without displaying the dialog. Works with any type of dialog, including the MsgBox. The sample includes code that changes OK on the MsgBox dialog to ALL.
Compiled sample application (VB5 run-time module required, VB6 SP3 Common Dialog Control required - NOTE that the UserControl will work with any version of the common dialog or with the common dialog API functions)
Download the MHDialogMagic control (subscribers only)
View a screenshot

MHDock

A docking control is one of the most requested. Just drop it on a Form and it will automatically dock with its parent window. An MDI child form will dock to the edges of its parent MDI form. An application top level form, such as an MDI form, will dock to the edges of the screen. It automatically compensates for the position and size of the taskbar. A Move event fires with parameters indicating the docking position - you could even use the control to provide just a Move event. Other parameters include settings for the X and Y offset positions to effect the dock.
Compiled sample application (VB5 run-time module required)
Download the MHDock control (subscribers only)
View a screenshot

MHDosText

This control will capture the text of a running DOS application. The DOS window must be "windowed" and not "full screen". It has a method and an event called EnumDOSWindows. The method causes the event to fire and return the window title of each open DOS window. You then pass that to the Text property and it returns the text of the DOS window. Note that this has been tested on WinNT, Win95, and Win98.
Compiled sample application (VB5 run-time module required)
Download the MHDosText control (subscribers only)
View a screenshot

MHFileChange

This control will notify you when a file or directory changes in a watched directory. Just set the directory to watch, like "c:\my documents", and the control will fire an event when a file in that directory is created, deleted, renamed, size changes, is written to, or attributes change. Events will also fire when directories are created, deleted, renamed, or attributes changed.
Compiled sample application (VB5 run-time module required)
Download the MHFileChange control (subscribers only)
View a screenshot

MHHook

If a docking control is one of the most requested, then THIS one is probably THE most requested. I couldn't even count the number of times I've been asked about a system wide keyboard hook. The free Keyhook sample shows how to hook the keyboard for an app, but system wide hooking is possible only from a true DLL - not from the OLE DLLs that VB can create. I've updated this control with Mouse, WndProc, SysMsgFilter, and MsgFilter hooks! Just drop the control on a form. There are KeyDown/KeyUp events for keyboard hooks. They fire anytime a key is pressed in any application. The events I've added are MouseDown/MouseMove/MouseUp for mouse hooks, WndProc for the WndProc hook. That one only works for a specific message - you must pass the message to watch, like WM_CREATE or somesuch. The control also fires SysMsg and Msg events for the message filters. It passes every parameter of the message hook event. Both the VB and Visual C++ 6.0 code is included, along with a compiled DLL. This control has been updated to work better with VB5 on Win9x machines.
Download the MHHook control (subscribers only)
View a screenshot

MHPageNo

This control adds a page break indicator to the RichTextBox control - it works similar to the page break in Microsoft Word. The control includes a PrintRTB method that allows you to print a specific page number. It basically implements the formatting and printing outlined in KB article Q146022 in addition to the code needed for the page break indicator.
Compiled sample application (VB5 run-time module and Windows Common Controls SP3 required)
Download the MHPageNo control (subscribers only)
View a screenshot

MHUpDown

This is a replacement UpDown control. As you can see by the screenshot, it looks better than other spin buttons, because it actually sits inside a TextBox rather than beside one. Not only that, but it can Increment anywhere from .0001 units on up, including greater than 1 unit (like 5 or 10 units). It also has optional AutoFocus and AutoSelect properties to force Focus and/or Selection to the TextBox containing the UpDown control being clicked.
Compiled sample application (VB5 run-time module required)
Download the MHUpDown control (subscribers only)
View a screenshot

Copyright © 2000 by Matt E. Hart, All Rights Reserved Worldwide.
Nothing on this web site may be reproduced, in any form, without express written consent.