Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.



Public Function Squeeze(lbLeft As ListBox, lbRight As ListBox, sb As SpinButton, tbHits As TextBox, lngDirection As Long)
' Procedure :   cmd_Squeeze
' Description:  Modifies the appearance of the listboxes according to the Spin Button.
' Copyright:    Chris Greaves Inc.
' Inputs:       Left- and Righ listboxes, Spin button, long direction (+1, -1)
' Returns:      None
' Assumes:      Nothing
' Side Effects: None.
' Tested:       By a call from the user.
    If lngDirection < 0 Then
        If (lbLeft.Width - lngDirection) > intcMinimumListBoxWidth Then
            lbLeft.Width = lbLeft.Width + lngDirection ' left box becomes narraower
            lbRight.Left = lbRight.Left + lngDirection ' right box shifts left
            lbRight.Width = lbRight.Width - lngDirection ' right box becomes wider
            sb.Left = sb.Left + lngDirection  ' spin button shifts left
            tbHits.Left = tbHits.Left + lngDirection ' Hits box shifts left
        Else ' Listbox is lesss that intcMinimumListBoxWidth. make no change
        End If
    Else
    End If
    If lngDirection > 0 Then
        If (lbRight.Width - lngDirection) > intcMinimumListBoxWidth Then
            lbRight.Width = lbRight.Width - lngDirection ' right box becomes narraower
            lbRight.Left = lbRight.Left + lngDirection ' right box shifts right
            lbLeft.Width = lbLeft.Width + lngDirection ' left box becomes wider
            sb.Left = sb.Left + lngDirection  ' spin button shifts left
            tbHits.Left = tbHits.Left + lngDirection ' Hits box shifts right
        Else ' Listbox is lesss that intcMinimumListBoxWidth. make no change
        End If
    Else
    End If
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1

Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.

Public Function Squeeze(lbLeft As ListBox, lbRight As ListBox, sb As SpinButton, tbHits As TextBox, lngDirection As Long)
' Procedure :   cmd_Squeeze
' Description:  Modifies the appearance of the listboxes according to the Spin Button.
' Copyright:    Chris Greaves Inc.
' Inputs:       Left- and Righ listboxes, Spin button, long direction (+1, -1)
' Returns:      None
' Assumes:      Nothing
' Side Effects: None.
' Tested:       By a call from the user.
    If lngDirection < 0 Then
        If (lbLeft.Width - lngDirection) > intcMinimumListBoxWidth Then
            lbLeft.Width = lbLeft.Width + lngDirection ' left box becomes narraower
            lbRight.Left = lbRight.Left + lngDirection ' right box shifts left
            lbRight.Width = lbRight.Width - lngDirection ' right box becomes wider
            sb.Left = sb.Left + lngDirection  ' spin button shifts left
            tbHits.Left = tbHits.Left + lngDirection ' Hits box shifts left
        Else ' Listbox is lesss that intcMinimumListBoxWidth. make no change
        End If
    Else
    End If
    If lngDirection > 0 Then
        If (lbRight.Width - lngDirection) > intcMinimumListBoxWidth Then
            lbRight.Width = lbRight.Width - lngDirection ' right box becomes narraower
            lbRight.Left = lbRight.Left + lngDirection ' right box shifts right
            lbLeft.Width = lbLeft.Width + lngDirection ' left box becomes wider
            sb.Left = sb.Left + lngDirection  ' spin button shifts left
            tbHits.Left = tbHits.Left + lngDirection ' Hits box shifts right
        Else ' Listbox is lesss that intcMinimumListBoxWidth. make no change
        End If
    Else
    End If
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1