|
Forcing a local or remote NT system to reboot
|
Total Hit (2905) |
Under Windows NT, you can force a timed system shutdown on either the local machine or a remote network machine. This code tip shows how to do it. You can specifiy how long it will be before the machine will be shutdown in seconds (a zero value shuts down immediately), how remorseless the shutdown p
....Read More |
Rating
|
|
|
Start a document based on its filename
|
Total Hit (1263) |
Starting any document file based on its file name only is very simple in Windows using the ShellExecute function. This tip shows how simple it is - you only really need one declare and one line of code!
|
Rating
|
|
|
Restrict Mouse Movement to an Area of the Desktop
|
Total Hit (2021) |
This tip shows you how to ensure a cursor remains within a certain rectangle on the screen. Note that if the user uses Alt-Tab to switch to another application, the clipping cursor is cleared.
|
Rating
|
|
|
Read the NumLock and CapsLock key states
|
Total Hit (2121) |
This sample demonstrates how to determine the state of the NumLock and CapsLock key (plus any other key on the keyboard at the same time).
|
Rating
|
|
|
Read A Custom Clipboard Format
|
Total Hit (2722) |
VB limits you to getting information in just the standard clipboard formats. However, a number of applications paste information in other formats, for example Rich Text Format, HTML format and so forth. This tip shows you how to read the data for a custom format from the clipboard as a string.
....Read More |
Rating
|
|
|
|
Force an area of a Window to Repaint
|
Total Hit (2222) |
This sample shows how to force an area of a window to repaint. Sometimes this is necessary, particularly when you're experimenting with owner draw control techniques, or when using the LockWindowUpdate API call to improve the speed at which a control fills with data.
....Read More |
Rating
|
|
|
.NET Button ListBar Control
|
Total Hit (2316) |
The Button ListBar control provides an emulation of the ListBar provided in the Windows Add/Remove Programs window. Under XP it uses the UxTheme API to draw parts of the toolbar, and degrades to use standard GDI drawing calls when used on earlier OS versions. Both C# and VB.NET versions of the same
....Read More |
Rating
|
|
|
VS.NET ListBar Control
|
Total Hit (1229) |
This control uses the Outlook Style ListBar control as a basis for a full implementation of a Visual Studio-style List Bar which holds lists of controls. Bars and items can be dragged around the control, and items can be dragged, pressed or double-clicked to add the item to an object. For additional
....Read More |
Rating
|
|
|
Skinned ListBar
|
Total Hit (2002) |
This article demonstrates overriding the drawing routines in the Outlook Style ListBar to create a new ListBar which inherits the behaviour of the original control but draws in a much customised way.
|
Rating
|
|
|
.NET Outlook Style ListBar Control
|
Total Hit (1884) |
The .NET ListBar control aims to provide the most accurate reproduction of the Microsoft Outlook bar control. All the features of the Outlook bar control are supported and more: in particular the control provides nicer drag-drop operation, has more display modes and provides an extensible object mod
....Read More |
Rating
|
|
|
Cancellable In-Place Edit Popups
|
Total Hit (1700) |
Controls like the ListView and the Outlook ListBar allow you to edit items in place by either double-clicking them or through a context UI feature such as a menu. This article provides a class which helps with the tricky parts of implementing in-place editing, and demonstrates how to use it to creat
....Read More |
Rating
|
|
|
Use .NET Forms as Popup Windows
|
Total Hit (2357) |
This article provides a reusable class which you can use to convert a form into a popup which works in the same way as the drop-down portion of a ListBox or the popup controls for picking colours or tables in Office. In addition to wrapping all the functionality you need to ensure the popup is cance
....Read More |
Rating
|
|
|
Floating Controls, Tooltip-style
|
Total Hit (2442) |
This article started when I was implementing the VS.NET ListBar control. If you move the mouse over an item whose text is partially obscured in the VS.NET ListBar, a popup appears to show more of the text. The same technique is also implemented in the ListView and TreeView controls using a ToolTip.
....Read More |
Rating
|
|
|
Font ComboBox
|
Total Hit (2570) |
This control adds a thin wrapper around the Icon ComboBox to convert it into an Office-style font picker control. Features include a most-recently used font section, initialisation on a background thread, auto-complete and built-in detection of non-character fonts like Wingdings (VB.NET and C# code
....Read More |
Rating
|
|
|
Virtual ListBox
|
Total Hit (2223) |
Virtual List Boxes can be used if you ever need to try and show a list containing a vast quantity of data. Instead of adding physical objects to the ListBox, instead you tell it how many rows there should be, and it simply defers all drawing of items to the owner of the box using owner draw item met
....Read More |
Rating
|
|
|
Adding an Icon or Control to a TextBox or ComboBox
|
Total Hit (2670) |
The standard .NET Framework ComboBox does not support an icon in the text box section of the control. This article presents a class which can be used to show an icon, a control or a custom-drawn image into any TextBox or ComboBox (VB.NET and C# code provided).
....Read More |
Rating
|
|
|
Reusing The ComboBox DropDown
|
Total Hit (1097) |
Normally, the combo box drop-down portion only appears underneath the combo box part of a control. However, using an age-old Windows hack you can get at the handle of the drop-down List and move it to any position you like on screen. This article provides a reusable class for manipulating the drop-d
....Read More |
Rating
|
|
|
Flat Style Combo Boxes
|
Total Hit (2198) |
This article provides a class which you can attach to any .NET ComboBox control to allow it to render with a VS.NET or Office XP flat style by subclassing the messages associated with the control (VB.NET and C# code provided).
|
Rating
|
|
|
vbAccelerator IconComboBox Control
|
Total Hit (1604) |
One of the more notable omissions from the set of .NET Framework Windows controls is a Combo Box which supports icons, despite a control of this type being used to good effect in Explorer and IE. This article provides a reusable control which extends the standard ComboBox to allow you to associate i
....Read More |
Rating
|
|
|
Sophisticated Drag-Drop Images
|
Total Hit (2196) |
The standard .NET Framework drag-drop functionality provides a cursor to indicate that a drag-drop function is in progress. This article demonstrates how to add an image of the object being dragged to the drag-drop control, in the same way that Explorer does using the ImageList APIs.
....Read More |
Rating
|
|
|
|
Change the drop-down width of a Combo Box
|
Total Hit (2044) |
This tip shows you how to get and set the width of the drop down portion of a combo box. It also includes code to automatically set the drop down width based on the contents of a combo box by measuring the size of the text in each combo box item.
|
Rating
|
|
|
Get System Display Fonts and Non-Client Area Sizes
|
Total Hit (2676) |
The Non-Client area of a window is defined as the area you don't draw on; i.e. the window border, caption, menu bar and scroll bars. Whilst it is easy to get the colours that Windows uses to display these items (the VB enumeration SystemColorConstants supplies all the OLE_COLOR versions of these col
....Read More |
Rating
|
|
|
Using PSAPI to get a complete task list and memory usage.
|
Total Hit (3947) |
PSAPI.DLL is a DLL provided for NT/2000/XP systems which greatly simplifies the job of getting task list and memory usage information. The information is also available in the dyamic data section of the registry, but the format is fairly obstructive and it is a considerable task to extract it progra
....Read More |
Rating
|
|
|
Show and Hide a Form's Titlebar at run-time
|
Total Hit (2359) |
This tip shows you how to show and hide the title bar of a window at run-time. To make a window's title bar disappear, you have to remove the control box, the maximise box and the minimise box as well as set the caption of the form to blank. Unfortunately, VB's ControlBox, MinButton and MaxButton pr
....Read More |
Rating
|
|
|
|
|
How to Shutdown the System in Windows 9x and NT
|
Total Hit (2864) |
This tip demonstrates how to shutdown, logoff and/or reboot a system. Shutting down a Windows 9x system is very straightforward - just one API call to ExitWindowsEx is all that is required. However, under NT it is a little more tricky. By default, no application processes under Windows NT have the p
....Read More |
Rating
|
|
|
Get an RGB Colour from an OLE_COLOR
|
Total Hit (1592) |
Sometimes you need to know the Red, Green and Blue values of a Visual Basic/COM OLE_COLOR, particularly if you are going to use the colour in an API function. This tip shows you how to correctly convert an OLE_COLOR type to a RGB value using the OleTranslateColor API call exposed by OLEPRO32.DLL. It
....Read More |
Rating
|
|