| VB Extension Tools HTML project report | |
| Project: LabledControls | Module: MDefault |
| Module Type  | Standard module  |
|---|---|
| File  | C:\Code\EE-projects\units\vb\standard\src\Default.bas  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 04 30  |
| Purpose  |
Several declarations and methodes, which can be useful for any VB project and do not belong to a certain category.  |
| EventNotifier (gEventNotifier) |
| Procedure 'CenterForm' | List of procedures |
| Scope/Type  | Public Sub  |
|---|---|
| Code parameters  | frm As Form  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 03 28  |
| Purpose  | Placing a form to the center of the screen.  |
| Procedure 'CheckThousendSeperator' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
pfThousendSeparatorForbidden As Boolean psInputCharacter As String psThousendSep As String psDecimalSep As String psMessageBoxCaption As String  |
| Code return value  | Boolean  |
| Author  | Ralf Kunsmann  |
| Date  | 2004 09 13  |
| Purpose  |
Check, if user entered the character which is defined as Digit Separator (Thousend Separator).  |
| Result  | Boolean: True, if charater entered is valid, else False.  |
| Procedure 'TextMark' | List of procedures |
| Scope/Type  | Public Sub  |
|---|---|
| Code parameters  | txt As TextBox  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 03 28  |
| Purpose  | Mark all the text in a TextBox-Control.  |
| Procedure 'SetControlBackcolor' | List of procedures |
| Scope/Type  | Public Sub  |
|---|---|
| Code parameters  |
psType As String pfrm As Form piColor As Long  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 03 28  |
| Purpose  |
Set backcolor property of controls of given type in given form to given value.  |
| In parameters  |
Label of the control type, reference to the form object, color id  |
| Procedure 'RefreshNow' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
ByVal piInterval As Long ByRef prLast As Currency  |
| Code return value  | Boolean  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 03 28  |
| Purpose  |
Using 'timeGetTime', we check whether a given time interval is run over.  |
| Result  | True if time has pase, else False.  |
| In parameters  |
Interval in milliseconds. Last access in milliseconds since the start of the PC.  |
| Procedure 'GetProc' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  | Proc As Long  |
| Code return value  | Long  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 02 16  |
| Purpose  |
If MS would support us programmers in a way we can expect, this function would not be necessary ... What we want the do is to assign the address of a function to a variable. But the easy way is locked (i = AddressOf [Function])  |
| Result  | AddressOf [Function]  |
| In parameters  | AddressOf [Function]  |
| Procedure 'SaveWindowSettings' | List of procedures |
| Scope/Type  | Public Sub  |
|---|---|
| Code parameters  |
frm As Form Optional sRegi As String Optional sName As String Optional fPositionOnly As Boolean = False  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 03 28  |
| Purpose  |
Save the current size and position of a form to the registry. Settings are saved to a subkey of [HKEY_CURRENT_USER\Software\VB and VBA Program Settings]  |
| In parameters  |
Reference to the form concerned. Name of the first level sub key. Name of the second level sub key. Flag showing if only position or position and size is saved.  |
| Procedure 'RestoreWindowSettings' | List of procedures |
| Scope/Type  | Public Sub  |
|---|---|
| Code parameters  |
frm As Form Optional sRegi As String Optional sName As String Optional fPositionOnly As Boolean = False  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 03 28  |
| Purpose  |
Restore the size and position of a form from the registry. Settings are read trom a subkey of [HKEY_CURRENT_USER\Software\VB and VBA Program Settings].  |
| In parameters  |
Reference to the form concerned; Name of the first level sub key; Name of the second level sub key; Flag showing if only position or position and size is saved.  |
| Procedure 'VBGetPrivateProfileString' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
ByVal psIniFile As String ByVal psSection As String ByVal psEntry As String Optional ByVal psDefault As String = ""  |
| Code return value  | String  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 03 08  |
| Purpose  | Wrapper to the API 'GetPrivateProfileString' function  |
| Result  | A string containing the setting.  |
| In parameters  |
File path to the ini file; Name of the section in the ini file; Name of the setting in the section; Default setting (for the case, that not value can be found).  |
| Procedure 'VBWritePrivateProfileString' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
ByVal psIniFile As String ByVal psSection As String ByVal psEntry As String ByVal psValue As String  |
| Code return value  | Boolean  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 03 08  |
| Purpose  | Wrapper to the API 'WritePrivateProfileString' function.  |
| Result  | True on success, else False.  |
| In parameters  |
File path to the ini file; Name of the section in the ini file; Name of the setting in the section; Value to be saved.  |
| Procedure 'VBWritePrivateProfileSection' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
ByVal psIniFile As String ByVal psSection As String ByVal psValues As String  |
| Code return value  | Boolean  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 03 08  |
| Purpose  | Wrapper to the API 'WritePrivateProfileSection' function.  |
| Result  | True on success, else False.  |
| In parameters  |
File path to the ini file; Name of the section in the ini file; Name of the setting in the section; Value to be saved.  |
| Procedure 'VBGetPrivateProfileSectionNames' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  | ByVal lpFileName As String  |
| Code return value  | Variant  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 03 28  |
| Purpose  | Wrapper to the API 'GetPrivateProfileSectionNames' function.  |
| Result  | An Array of strings with one item for each section.  |
| In parameters  | Ini file path.  |
| Procedure 'VBGetPrivateProfileSection' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
ByVal lpFileName As String ByVal lpSectionName As String  |
| Code return value  | Variant  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 03 28  |
| Purpose  | Wrapper to the API 'GetPrivateProfileSection' function.  |
| Result  | A string array containing all keys and values of a ini section.  |
| In parameters  | Ini file path, section name.  |
| Procedure 'GetErrorInfo' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  | Err As ErrObject  |
| Code return value  | String  |
| Author  | Ralf Kunsmann  |
| Date  | 2004 10 12  |
| Purpose  | Extract information about a code error from the Error object.  |
| Procedure 'GetHorBorder' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  | frm As Form  |
| Code return value  | Long  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 05 14  |
| Purpose  |
Get the horicontal borders of a form by subtracting scalewidth from width.  |
| Result  | Long value in twips.  |
| In parameters  | Object variable with reference to the related form.  |
| Procedure 'GetVerBorder' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  | frm As Form  |
| Code return value  | Long  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 05 14  |
| Purpose  |
Get the Vertical borders of a form by subtracting scaleheight from height.  |
| Result  | Long value in twips.  |
| In parameters  | Object variable with reference to the related form.  |
| Procedure 'SetRecordsetCursor' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
prs As Recordset psField As String piID As Long  |
| Code return value  | Boolean  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 05 04  |
| Purpose  | Try to set the cursor of a recordset to a certain position.  |
| Result  | True if posible, else False.  |
| In parameters  |
Object reference to the related recordset; Name of the related database table field; ID of the sought-after record.  |
| Procedure 'ByteArrayToString' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  | bString  |
| Code return value  | Byte  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 06 06  |
| Purpose  |
Converts as Byte array with string characters to VB String data type.  |
| Procedure 'StringFixLen' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
ByRef sString As String ByRef iLen As Long Optional sFillUp As String = " "  |
| Code return value  | String  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 06 12  |
| Purpose  | Fill up or cut a string to the given length.  |
| Result  | Modified string.  |
| In parameters  | String to be checked. Given length.  |
| Procedure 'EnumerateGrid' | List of procedures |
| Scope/Type  | Public Sub  |
|---|---|
| Code parameters  |
grd As Control iStartRow As Long iCol As Long sFormat As String  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 06 29  |
| Purpose  | Enumerates a grid control.  |
| In parameters  |
Reference to the grid control; Row, where enumeration has to start; Column, where enumeration has to display; Number format for then enumeration.  |
| Procedure 'CheckBoolean' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
s As String sFormat As String  |
| Code return value  | Boolean  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 06 29  |
| Purpose  |
Check a boolean, formated as text in one of the valid format string of current country setting.  |
| Result  | True or False  |
| In parameters  |
Boolean formated as string; Format string to test on. Must be "Yes/No", "True/False" or "On/Off".  |
| Procedure 'BuildCollectionFromDBTable' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
pdb As Database psTable As String psKeyField As String psValueField As String Optional psCriteria As String  |
| Code return value  | Collection  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 08 31  |
| Purpose  | Build a collection object from a records of database table.  |
| Result  | Collection object.  |
| In parameters  |
Reference to the database. Name of the database table. Name of key field. Name of value field. Optinal string containing selection criteria.  |
| Procedure 'CreateCommandButton' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
frm As Form psName As String psText As String Optional piLeft As Long = 0 Optional piTop As Long = 0 Optional piWidth As Long = 1500 Optional piHeight As Long = 300  |
| Code return value  | CommandButton  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 09 06  |
| Purpose  | Creates a command button on a form.  |
| Result  |
Reference to the created command button, if creation was successful, else 'Nothing'.  |
| In parameters  |
Reference to the form, Control name as string, Control caption as string, Control left position as long, Control top position as long, Control width as long, Control height as long.  |
| Procedure 'CreateLabel' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
frm As Form psName As String psText As String Optional piLeft As Long = 0 Optional piTop As Long = 0 Optional piWidth As Long = 1500 Optional piHeight As Long = 270  |
| Code return value  | Label  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 09 06  |
| Purpose  | Creates a label control on a form.  |
| Result  |
Reference to the created command button, if creation was successful, else 'Nothing'.  |
| In parameters  |
Reference to the form, Control name as string, Control caption as string, Control left position as long, Control top position as long, Control width as long, Control height as long.  |
| Procedure 'CreateControl' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
frm As Form psType As String psName As String piLeft As Long piTop As Long piWidth As Long piHeight As Long  |
| Code return value  | Control  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 09 06  |
| Purpose  | Creates a default (VB internal) control on a form.  |
| Result  |
Reference to the control, if creation was successful, else 'Nothing'.  |
| In parameters  |
Reference to the form, Control name as string, Control type identifier as string, Control left position as long, Control top position as long, Control width as long, Control height as long.  |
| Procedure 'CreateGUID' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code return value  | String  |
| Author  | Ralf Kunsmann  |
| Date  | 1999 07 16  |
| Purpose  | Creats a GUID.  |
| Result  | String containing GUID.  |
| Procedure 'SetComboBoxItem' | List of procedures |
| Scope/Type  | Public Sub  |
|---|---|
| Code parameters  |
ComboBoxControl As Object Item As Variant Optional ForceString As Boolean  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 05 02  |
| Purpose  | Activating an item of a ComboBox control  |
| In parameters  |
Object reference to the related control String or number defining the item that should be activated Flag showing if the item parameter has to be treated as a string  |
| Procedure 'SetGridDataRangeBackColor' | List of procedures |
| Scope/Type  | Public Sub  |
|---|---|
| Code parameters  |
GridControl As Control Color As Long Optional StartRow As Long Optional EndRow As Long Optional StartCol As Long Optional EndCol As Long  |
| Author  | Code Helper  |
| Date  | 06.07.2001  |
| Purpose  | Set BackColor property of MSHFlexGrid control.  |
| In parameters  |
Reference to grid control. Backcolor as long value  |
| Procedure 'LibFuncAvailable' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
Library As String FunctionName As String  |
| Code return value  | Boolean  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 10 17  |
| Purpose  |
Check if a function is available in a library (DLL function library).  |
| Result  | True is available, else False.  |
| In parameters  |
String containing library name. String containing function name.  |
| Procedure 'AddSectionHeaderBrackets' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  | ByVal psSectionHeader As String  |
| Code return value  | String  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 03 29  |
| Purpose  |
Adds brackets for a ini file section header. E.g. EMM386 --> [EMM386].  |
| Result  | String.  |
| In parameters  | String.  |
| Procedure 'DelSectionHeaderBrackets' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  | ByVal psSectionHeader As String  |
| Code return value  | String  |
| Author  | Ralf Kunsmann  |
| Date  | 2001 03 29  |
| Purpose  |
Delete brackets from a ini file section header. E.g. [EMM386] --> EMM386.  |
| Result  | String.  |
| In parameters  | String.  |
| Procedure 'Max' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
r1 As Double r2 As Double  |
| Code return value  | Double  |
| Author  | Ralf Kunsmann  |
| Date  | 2003 10 15  |
| Purpose  | Return the maximum of two given numbers.  |
| Result  | Double  |
| Procedure 'Min' | List of procedures |
| Scope/Type  | Public Function  |
|---|---|
| Code parameters  |
r1 As Double r2 As Double  |
| Code return value  | Double  |
| Author  | Ralf Kunsmann  |
| Date  | 2003 10 15  |
| Purpose  | Return the minimum of two given numbers.  |
| Result  | Double  |
| Procedure 'GetSeps' | List of procedures |
| Scope/Type  | Public Sub  |
|---|---|
| Code parameters  |
ByRef psThousendSep As String ByRef psDecimalSep As String  |
| Author  | Ralf Kunsmann  |
| Date  | 2002 03 22  |
| Purpose  | Get separators for digit grouping and decimal digits.  |