' = HERE IS THE ACTUAL WORK FOR THIS ACTIVEX CONTROL Private Sub Command1_Click()Įnd Sub Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
![where to put ocx files where to put ocx files](https://i.ytimg.com/vi/FR7apz7uWZ4/maxresdefault.jpg)
Wish as part of the event, which is important and useful to remember! In this simple example, I'm just forwarding the values as retrieved by theĬommand button in the first place, but you can send back any information you In the case of the MouseDownĮvent however, four parameters are supplied as in the declaration from above. The name of the event that's being fired. That in the case of the Click event, no parameters are included except This is done using the RaiseEvent function. What happens in them is the acutal firing of the eventsĪs declared above so that they can be captured and handled by someone using Finally we have a couple of methods that simply handle events as fired byĪ command button.' = HERE ARE SOME USERCONTROL HANDLERS Private Sub UserControl_Initialize() Here'sĪn example of a couple of these events being used to resize the button toīe the size the developer draws the UserControl to and to set the initial Have as much control over your user control as you do over a form in VB. Of events and methods associated with that progression. Similar to a Form in VB, a UserControl has a life and a death and a bunch The next two subs are just some stuff associated with the UserControl object.' = HERE ARE SOME PROPERTIES Property Get Caption() As StringĮnd Property Property Let Caption(newCap As String) The Caption property of the command button. Of the command button and the let just returns the current string found in Let takes in a new string and just assigns it to the Caption property The basic idea of these functions is that the Instead of just simple data types ( I'm pretty sure of this, remind There is also a Set function which can be used for complex objects (which is used when someone wants to change the value of a property) function. The value of the property when it is requested externally) and a Let To a control, you have to provide a Get (which will be used to return
#Where to put ocx files code#
The next section of code deals with the one property our button control.Option Explicit ' = HERE ARE SOME EVENTS Event Click()Įvent MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) This control with those four pieces of information to be used in whichever MouseDown event has four parameters (ie, it will provide someone using Using this control beyond that a "click" was fired) and that the No parameters (ie the idea is that it provides no information to someone The thing to note is that the Click event has There are two events we're going to provide to people using this control,
![where to put ocx files where to put ocx files](https://thegeekpage.com/wp-content/uploads/2018/09/comctl32.ocx-file-is-missing-or-invalid.jpg)
![where to put ocx files where to put ocx files](https://robbamforth.files.wordpress.com/2015/06/screenshot-2015-06-17-13-52-17.png)