dcsimg
July 16, 2018
Hot Topics:

Making Your Own Custom Control

  • November 19, 2002
  • By Sam Huggill
  • Send Email »
  • More Articles »

Ever wondered how to put all of your 500-line code into your own control? Well now there's a way.

Using the Visual Basic 5 Control Creation Edition or Visual Basic 5 (although the CCE is free), you can create your own controls. This has been very beneficial to companies such as Data-Dynamics and Sheridan. They have made a lot of money with their own controls (see my previous article on custom controls).

Well, in the next two weeks I will show you a simple demonstration of how to make two different types of controls.

The first will make your program stay 'on top'. Make a new ActiveX control and add a .bas module (Project, Add Module). This first piece of code sets some constants and uses an API call on the 'user32' library. Add this code to the module:

Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOACTIVATE = &H10
Public Const SWP_SHOWWINDOW = &H40
Public Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Public Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal x As Long, y, ByVal cx As Long, ByVal cy As Long, _
ByVal wFlags As Long) As Long




Page 1 of 3



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

Thanks for your registration, follow us on our social networks to keep up-to-date