How to create round corners at entry fields?


#1

Hi All
How to create round corner at entry fields?


#2

Hi,

the easiest way is to create some image and put this on form. Then put your entry field on this image and turn on the transparent attribute


#3

Have a look at Capesofts Makeover


#4

Put a box control over the field, round, with the same size and make the field transparent


#5

Try this:

 !---BeforeGlobalIncludes
 HANDLE     EQUATE(UNSIGNED)
 HRGN       EQUATE(HANDLE)
 HWND       EQUATE(HANDLE)
 HGDIOBJ    EQUATE(HANDLE)

 RECT    GROUP,TYPE
 Left       SIGNED
 Top        SIGNED
 Right      SIGNED
 Bottom     SIGNED
        END

 !---InsideGlobalMap
   MODULE('Windows.DLL')
     GetWindowRect(UNSIGNED hWnd, *RECT lpRect),BOOL,PASCAL,RAW,PROC
     CreateRoundRectRgn( SIGNED, SIGNED, SIGNED, SIGNED, SIGNED, SIGNED),HRGN,PASCAL
     SetWindowRgn(HWND,HRGN,BOOL),SIGNED,PASCAL
     DeleteObject(HGDIOBJ),BOOL,PASCAL
   END

!----Procedure
RoundIt PROCEDURE(LONG pControl)
hRgn LONG
LOC:Width LONG
LOC:Height LONG
LOC:RECT LIKE(RECT)
CODE
GetWindowRect(pControl{PROP:HANDLE},LOC:RECT)

LOC:Width  = LOC:RECT.Right - LOC:RECT.Left
LOC:Height = LOC:RECT.Bottom - LOC:RECT.Top

hRgn = CreateRoundRectRgn(0,0,LOC:Width, LOC:Height,  5, 5)
    
IF hRgn
    SetWindowRgn(pControl{PROP:HANDLE}, hRgn, 1)
    DeleteObject(hRgn)
END

!----Function call on init.OpenWindow
RoundIt(?YourControlGoesHere)

NOTE: Entry control has to be FLAT
Sample screenshot


#6

It looks good but I can’t get round corner at entry field.
Test.zip (1.8 KB)

Thanks anyway


#7

Looks like the Zip is corrupted… I am not able to open it… Can you please re-attach it for me.

Thanks


#8

Take a look at ‘magic entries’ from icetips (www.icetips.com’. Price = $ 49 and does exactly what you want - and even more. It’s even a nice example of template programming.


#9

Here it is againtest.zip (14.8 KB)


#10

Try Icetips magicentries. Allows rounded entry fields and defines global colours for required, read-only etc.