Event KeyDown(KeyCode As Integer, Shift As Integer)
Event KeyUp(KeyCode As Integer, Shift As Integer)
Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Private Sub Command1_KeyDown(KeyCode As Integer, Shift As Integer)
RaiseEvent KeyDown(KeyCode, Shift)
End Sub
Private Sub Command1_KeyUp(KeyCode As Integer, Shift As Integer)
RaiseEvent KeyUp(KeyCode, Shift)
End Sub
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseDown(Button, Shift, X, Y)
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseMove(Button, Shift, X, Y)
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseUp(Button, Shift, X, Y)
End Sub
Control's special events
Private Sub UserControl_Initialize()End Sub
The code that you will insert to this sub, will run when
the user first place the control on the form on design time,
and on runtime, when the form with the control on it is loaded.
Private Sub UserControl_Show()
End Sub
This event occur instantly after the Initialize event occur.
The initialize event occur After the control is loaded and before
the Control is visible (to the programmer or the user that run the program)
and the Show event occur right after the Control is visible to the programmer/user.
You can browse for other event: At the control's code window,
choose UserControl from the left ComboBox under the title bar,
and choose event with the right ComboBox.
Setting Control's propertiesAs you probably saw, when you inserted the control to your project,
the control had a default icon on the ToolBox.
To set your own Icon, Add your icon to the control ToolBoxBitmap property.
Some of the controls are invisible at runtime (Like Timer and ImageList).
To set your control to be invisible at runtime,
Set the control InvisibleAtRuntime property to True.
Make an About box
Make an About property, that when the user will
press on the About property cell on the control Properties window,
A message box will show up with your details.
Add the following code to your form:
Public Sub AboutBox()
MsgBox "This is my message", , "This is my title"
End Sub
Now from the menu choose Tools->Procedure Attributes.
From the 'Name' combo box choose AboutBox,
Click on the Advanced button, and from the 'Procedure ID'
choose AboutBox, and press OK.
Now a New property has just been added to your control - the About Property.Click on the Advanced button, and from the 'Procedure ID'
choose AboutBox, and press OK.


Subscribe to email feed



