Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1449

Hand-rolled windowless Button demo.

$
0
0
An interesting topic about windowless buttons came up recently and it gave me the idea for this demo. Most people are used to controls having a window handle, a window procedure and a device context because this is typically how controls work in Windows. However, this is not always the case. There are frameworks out there that have entire suites of controls that do not rely on any of this infrastructure from Windows.

This demo shows just how that can be done:-


It's a very unsophisticated demonstration of a windowless button. It is backed entirely by a class module with some GDI calls. No calls to CreateWindow, no hooking up of window procedures, no registering of windows classes and no use of UserControls. It's just a mix of pure GDI and VB6 code. As far as Windows and even VB6 is concerned, the above Form in the image has no controls on it's surface. Yet you will find that you can click on the buttons and they even respond to the mouse hovering over them just like actual controls. This is the illusion of windowless controls.

Have fun. :wave:
Attached Files

Viewing all articles
Browse latest Browse all 1449

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>