Guidance
指路人
g.yi.org
software / rapidq / Examples / QObject / Object / QrPanel.inc

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'QRPANEL is a sister component to QRFORM. It gives you the ability to create a panel with rounded corners.
'Thanks to everybody at the Yahoo board who shared their knowledge to build this one up :)
'
'Created the 1st of April 2004
'=========================================================================================================
'USEAGE:
'You need to pay attention to the special added event in QRPANEL. The "rBorder" - when you create panels
'with the QRPANEL component they will actually first get round corners when you set this to 1
'( rBorder = 1 ).
'Also RndX and RndY is new things - these 2 controls just how "round" the corners of the QRPANEL is.
'If you set these 2 high enough, you'll actually be able to make completely round panels.

     DECLARE FUNCTION CreateRoundRectRgn LIB "gdi32"ALIAS "CreateRoundRectRgn" (X1 AS LONG, Y1 AS LONG, X2 AS LONG, Y2 AS LONG, X3 AS LONG, Y3 AS LONG) AS LONG
     DECLARE FUNCTION SetWindowRgn LIB "user32" ALIAS "SetWindowRgn" (hwnd AS LONG, hRgn AS LONG, bRedraw AS LONG) AS LONG
     DECLARE FUNCTION DeleteObject LIB "gdi32" ALIAS "DeleteObject" (hObject AS LONG) AS LONG

     TYPE QrPanel EXTENDS QPANEL
      RndX AS LONG
      RndY AS LONG
      rBorder AS BYTE PROPERTY SET Paint

      PROPERTY SET paint(flag AS BYTE)
       DIM QpRegion AS LONG

       WITH this
        .rBorder = flag
        IF flag>0 THEN
         QpRegion = CreateRoundRectRgn(0,0,.Width,.Height,.RndX,.RndY)
         SetWindowRgn .handle, QpRegion, True
        END IF
       END WITH
      END PROPERTY

      CONSTRUCTOR
       RndX=20
       RndY=20
       Width = 100
       Height = 100
       rBorder = 0
      END CONSTRUCTOR
     END TYPE
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2023-2-4  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2004-04-01 14:33:33