Sub gp3dPanel (tForm As Form, tLeft As Single, tTop As Single,
               tWidth As Single, tHeight As Single, tRaised%)

tLeft = tLeft - 40
tTop = tTop - 20
tWidth = tWidth + 70
tHeight = tHeight + 50

    If tRaised = True Then   'give Raised 3d impression
        tColorBottomRight& = &H808080  'Grey
        tColorTopLeft& = &HFFFFFF 'White
        tWidthBottomRight% = 4
        tWidthTopLeft% = 3
        tDisplacementLeft% = 5
        tDisplacementTop% = 5
    Else                      'give Inset 3d impression
        tColorBottomRight& = &HFFFFFF  'White
        tColorTopLeft& = &H808080 'Grey
        tWidthBottomRight% = 3
        tWidthTopLeft% = 4
        tDisplacementLeft% = 0
        tDisplacementTop% = 10
    End If

    tTapering% = 5

    'calculated fields
    tRight! = tLeft + tWidth
    tBottom! = tTop + tHeight

'right line not tapering;
     DrawWidth = tWidthBottomRight%: tForm.Line
     (tRight! - 5, tTop + 10)-(tRight! - 5, tBottom! - 20),
     tColorBottomRight&

'bottom line not tapering;
     DrawWidth = tWidthBottomRight%: tForm.Line
     (tRight! - 5, tBottom! - 10)-(tLeft + 10, tBottom! - 10),
     tColorBottomRight&

'left line tapering on the bottom;
     DrawWidth = tWidthTopLeft%: tForm.Line (
     tLeft, tTop)-(tLeft, tBottom! - tTapering%), tColorTopLeft&
     DrawWidth = 1: tForm.Line
     (tLeft - tDisplacementLeft%, tBottom! - tTapering%)-
     (tLeft - tDisplacementLeft%, tBottom!), tColorTopLeft&

'top line tapering on the right;
    DrawWidth = tWidthTopLeft%: tForm.Line
    (tLeft, tTop)-(tRight! - tTapering%, tTop), tColorTopLeft&
    DrawWidth = 1: tForm.Line
    (tRight! - tTapering%, tTop - tDisplacementTop%)-
    (tRight!, tTop - tDisplacementTop%), tColorTopLeft&

End Sub
