Results 1 to 7 of 7

Thread: Shape Control

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    MD
    Posts
    182

    Shape Control

    I couldn't find shape control anywhere. Any help or alternate. I used to have a rectangle with blunted edges (Fillet) in VB.

    Thanks

  2. #2
    Addicted Member Sheppe's Avatar
    Join Date
    Sep 2002
    Location
    Kelowna, BC
    Posts
    245
    You're going to have to use the GDI+ Graphics class. There's a lot of example code out there.
    [vbcode]
    On Error Goto Hell
    [/vbcode]
    Sheppe Pharis, MCSD
    Check out http://www.vb-faq.com
    Click here for access to the free Code-Express source code and component sharing network for VB6
    Want a better way to skin your .NET applications? Click here!

  3. #3
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    You want the RoundRect API.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    MD
    Posts
    182
    Can you post some links for GDC or RoundRect.

    I tried RoundRect, but the following (bolded) code doesn't work.

    It needs hdc. But I tried even with Hande. What should I have there

    VB Code:
    1. Public Sub RoundRect(ByVal objPanel As Object, ByVal iLeft As Integer, ByVal iRight As Integer, ByVal iTop As Integer, ByVal iBottom As Integer)
    2.         Dim iEllipseWidth As Integer, iEllipseHeight As Integer
    3.  
    4.         ' define the rectangle's coordinates (in pixels)
    5.         iLeft = 5 : iTop = 5
    6.         iRight = 75 : iBottom = 40
    7.  
    8.         ' define the height and width of the ellipse to draw the rounded(rectangle)
    9.         iEllipseWidth = 10 : iEllipseHeight = 10
    10.  
    11.         ' draw the rounded rectangle
    12.         RoundRect([b]objPanel.hdc[/b], iLeft, iTop, iRight, iBottom, iEllipseWidth, iEllipseHeight)
    13.  
    14.     End Sub

  5. #5
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Wouldn't that function be recursive?

    You need to declare the API.

  6. #6
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by DiGiTaIErRoR
    Wouldn't that function be recursive?
    Looks like an infinate loop

    The current sub takes in arguements, then ignores their contents and replaces them with other arguments, and then calls itself with the arguments just created.

    ack! lol

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    MD
    Posts
    182
    Fixed that recursive thing. But doesn't do anything in the panel.

    I used the following link and somehow got it done on my form.

    http://vbforums.com/showthread.php?s...ight=RoundRect

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