Results 1 to 6 of 6

Thread: 3D line

  1. #1
    Guest

    Question

    Hey all

    In modern installation programs, theres usually a picture on the left side, on the right of the picture theres welcome text, and under those, theres a line and under the line theres the 'Back', 'Next' and 'Cancel' buttons. What control draws the 3D looking line? And what properties are set so that it looks that way? I've mucked around with the shape and line control but can't seem to get it right.

    Here is a picture of the line that I'm talking about:
    http://www.users.bigpond.com/sam...inc...sun/line.jpg

    Thanks,

    Sunny

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'this is close if you play with the color factors 
    'I'm sure you can grey it down...
    'there's a hockey game on...later
    
    'add a line using the shape control Shape1
    'put this in a bas module
    'Create A 3D Sunken Looking Control
    
    Public Sub ThreeDControl(Ctrl As _
    Control, nBevel, nSpace, bInset)
    
        Dim pixX As Integer, pixY As Integer
        Dim cTop As Single, cLts As Single
        Dim cRgt As Single
        Dim cBtm As Single
        
        
        pixX = Screen.TwipsPerPixelX
        pixY = Screen.TwipsPerPixelY
        
        cTop = Ctrl.Top - pixX
        CLft = Ctrl.Left - pixY
        cRgt = Ctrl.Left + Ctrl.Width
        cBtm = Ctrl.Top + Ctrl.Height
        Dim i As Integer
        Dim AddX As Integer, AddY As Integer
        
        ' Color used below:
        ' dark gray = &H808080
        ' white = &HFFFFFF
        
        If bInset Then         'inset border
          For i = nSpace To (nBevel + nSpace - 1)
           AddX = i * pixX
           AddY = i * pixY
           Ctrl.Parent.Line (CLft - AddX, cTop - _
           AddY)-(cRgt + AddX, cTop - AddY), &H808080
           Ctrl.Parent.Line (CLft - AddX, cTop - _
           AddY)-(CLft - AddX, cBtm + AddY), &H808080
           Ctrl.Parent.Line (CLft - AddX, cBtm + _
           AddY)-(cRgt + AddX + pixX, cBtm + AddY), &HFFFFFF
           Ctrl.Parent.Line (cRgt + AddX, cTop - _
           AddY)-(cRgt + AddX, cBtm + AddY), &HFFFFFF
          
            Next
                Else                      'outset border
          For i = nSpace To (nBevel + nSpace - 1)
           AddX = i * pixX
           AddY = i * pixY
           Ctrl.Parent.Line (cRgt + AddX, cBtm + _
            AddY)-(cRgt + AddX, cTop - AddY), &H808080
           Ctrl.Parent.Line (cRgt + AddX, cBtm + _
            AddY)-(CLft - AddX, cBtm + AddY), &H808080
           Ctrl.Parent.Line (cRgt + AddX, cTop - _
            AddY)-(CLft - AddX - pixX, cTop - AddY), &HFFFFFF
           Ctrl.Parent.Line (CLft - AddX, cBtm + _
            AddY)-(CLft - AddX, cTop - AddY), &HFFFFFF
          Next
        End If
    
    End Sub
    
    Private Sub Form_Activate()
    Shape1.BackColor = vbWhite
       Call ThreeDControl(Shape1, 1, 0, True)
    End Sub

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Guest
    It sure gives the shape the right look, however it seems the shape's height can't go anything below 8, and at 8 it appears much thicker than the normal line. Any workaround?

    Thanks for your help.

    Sunny

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Sorry!
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  5. #5
    Addicted Member overhill's Avatar
    Join Date
    Mar 2000
    Location
    KS, United States
    Posts
    181
    I found out how to do this by just fiddling around with TWO line controls some time ago

    Make two lines of equal length. Here are the settings for each.

    Line1
    BorderStyle = 1 - Solid
    BorderWidth = 2
    BorderColor = Highlight

    Line2
    BorderStyle = 1 - Solid
    BorderWidth = 1
    BorderColor = Scroll Bars

    Make sure that Line2 is on top of Line1 and it should look exactly like the line that you want!

  6. #6
    Guest
    Draw a frame and set its height property to 150.
    Remove the caption and you'll get the line.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width