Results 1 to 6 of 6

Thread: Use Just API

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Posts
    30

    Question

    I need to know how i can draw a rectangle on a form in the same with the same effect that you get when you place a shape-control on a form with FILLSTYLE set to 9.
    I'm able to only draw solid rects.
    The thing is that I need to use API Call. the LINE-command is no good.

  2. #2
    Junior Member
    Join Date
    Mar 1999
    Posts
    27

    Question Fillstyle - 9?

    What is Fillstyle - 9? I only have values 0 to 7 on my shape control...I can't tell you what Pen or Brush to use 'cause Fillstyle 9? But use anyways - the API function Rectangle - It should do what you want...btw - why wouldn't Line work?

    Good Luck

  3. #3
    Guest
    I don't know if this is the same as your problem, but lines always disappear when I draw them!!

  4. #4
    Junior Member
    Join Date
    Mar 1999
    Posts
    27
    If that's the problem set AutoRedraw = True or you can manually handle it by using the Paint event of the form/picturebox...

    Good Luck!

    [Edited by Cougar0119 on 04-24-2000 at 06:59 PM]

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Posts
    30
    I meant DRAWSTYLE instead of FILLSTYLE.
    I'll try the Rectangle API. The reason why I can't use the line function is that I'm drawing on the desktop.

  6. #6
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    there's a LineTo and a moveto API,
    Code:
     Private Declare Function LineTo Lib "gdi32" Alias "LineTo" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
    Private Declare Function MoveToEx Lib "gdi32" Alias "MoveToEx" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, lpPoint As POINTAPI) As Long
    they should be usefull, I'm not sure what lpPoint is, it's probably an out parameter for the old point.

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