IvcClient
Each Tab must implement IvcClient interface:
Implements IvcClient
See COM Tutorials on the website for details. As a bare minimum the following must be implemented:
Private Property Get IvcClient_ApplicationName() As String
IvcClient_ApplicationName = "SampleTab"
End Property
Private Function IvcClient_queryContextMenu() As Boolean
IvcClient_queryContextMenu = True
End Function
It is important to make sure, that no COM interfaces are active once the application event for shutting down is called, so make sure all COM instances are properly deleted:
Dim vcApp As IvcApplication
Private Sub UserControl_Initialize()
Set vcApp = New vcc3DCreate
End Sub
Private Sub IvcClient_notifyApplication(ByVal AppReady As Boolean)
If AppReady Then
‘Initialize
Else
Set vcApp = Nothing
End If
End Sub
In the above example only vcApp is defined as global variable. All global variables must be resetted before application is closed. Notice, that it is not necessary for Tab applications to register itself as a client, as this is done automatically.
Size of the control
The minimum width of the tab is 208 pixels. The maximum width of the tab is 632 pixels. The Height of the tab is not defined, but it may be ~400 pixels or even less. There is no defined maximum for the height. Usually this is not a problem though
In version 3.1.1 the Resize event works correctly and the size of the controls on the tab should be recalculated to match the new size.
Private Sub UserControl_Resize()
Text1.Move 10, 10, ScaleWidth - 20, ScaleHeight - 20
End Sub
Focus management
The ActiveX controls created with Visual Basic 6.0 the Tab looses the first (left) mouse click as this is used for ‘activating the UI'. The following workaround can be used to fix this problem. The workaround duplicates the mouse click in the EnterFocus event:
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Const MOUSEEVENTF_LEFTDOWN = &H2 'left button down
Const MOUSEEVENTF_LEFTUP = &H4 'left button up
Sub LeftMouseClick()
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End Sub
Private Sub UserControl_EnterFocus()
LeftMouseClick
End Sub
Colours

The 3DCreate.ini file defines the colour values of the above fields. The default for these is 12632256, that matches typically to windows colour ‘Silver'. It is recommended, that the Tab uses windows default colours for created controls. The background colour being typically ‘ButtonFace'.
Fonts
The default windows fonts should be used for controls. The font is ‘MS Sans Serif' with 8 pts size and color matching to ‘WindowText' (Usually black).
General design idea
There is very little real estate available. Therefore it is important to use it effectively. A simple way to spare the real estate is to reuse the same area for multiple purposes. Usually this is done by changing the context. Traditional way to set a context is Tabbed Panels. Another way (recommended) is to use WindowsXP like way to group Properties and Actions to similar groups and build these groups dynamically depending on the selected context.
The recommended components for context management are Treeview or Listview. When using listview, use the View Style ‘Report' without showing the Header Columns as this will give the similar looks as WindowsXP side Bar.
Example application: "Statistics"
The following image illustrates the basic layout

The upper part of the tab is used for selecting a context. Each context has its properties and actions. Main level division is ‘Global' and ‘Components'. Components can be of type Buffers, Machines and Accessories. Global contains several subitems, including ‘AutoRun'. Autorun can be constructed by dragging and dropping components under each run. Otherwise the upper part is for selecting only.
The above image does not contain any icons or different type of controls for properties. The idea is that each property is displayed with the value and the value can be changed by selecting the property. Once selected the appropriate windows controls are displayed.