home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / listx / subs.bas < prev    next >
Encoding:
BASIC Source File  |  1997-09-29  |  1.3 KB  |  43 lines

  1. Attribute VB_Name = "Module1"
  2. Option Explicit
  3.  
  4.  
  5. Public Sub Draw3DRect(canvas As Object, x As Integer, y As Integer, w As Integer, h As Integer, fLowered As Boolean)
  6.     Dim clrInnerTop As Long
  7.     Dim clrOuterTop As Long
  8.     Dim clrInnerBot As Long
  9.     Dim clrOuterBot As Long
  10.     Dim x1 As Integer
  11.     Dim y1 As Integer
  12.     Dim w1 As Integer
  13.     Dim h1 As Integer
  14.     
  15.     x1 = x + Screen.TwipsPerPixelX
  16.     y1 = y + Screen.TwipsPerPixelY
  17.     w1 = w - 2 * Screen.TwipsPerPixelX
  18.     h1 = h - 2 * Screen.TwipsPerPixelY
  19.     
  20.     If (fLowered) Then
  21.         clrOuterBot = RGB(192, 192, 192)
  22.         clrInnerBot = RGB(255, 255, 255)
  23.         clrInnerTop = RGB(192, 192, 192)
  24.         clrOuterTop = RGB(0, 0, 0)
  25.     Else
  26.         clrOuterBot = RGB(0, 0, 0)
  27.         clrInnerBot = RGB(128, 128, 128)
  28.         clrInnerTop = RGB(192, 192, 192)
  29.         clrOuterTop = RGB(255, 255, 255)
  30.     End If
  31.     
  32.     canvas.Line (x1, y1)-(x1 + w1, y1), clrInnerTop
  33.     canvas.Line (x1, y1)-(x1, y1 + h1), clrInnerTop
  34.     canvas.Line (x1 + w1, y1)-(x1 + w1, y1 + h1), clrInnerBot
  35.     canvas.Line (x1 + w1, y1 + h1)-(x1, y1 + h1), clrInnerBot
  36.     
  37.     canvas.Line (x, y)-(x + w, y), clrOuterTop
  38.     canvas.Line (x, y)-(x, y + h), clrOuterTop
  39.     canvas.Line (x + w, y)-(x + w, y + h), clrOuterBot
  40.     canvas.Line (x + w, y + h)-(x, y + h), clrOuterBot
  41. End Sub
  42.  
  43.