Hi All
How to create round corner at entry fields?
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
Have a look at Capesofts Makeover
Put a box control over the field, round, with the same size and make the field transparent
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
RETURN
**!----Function call on init.OpenWindow**
RoundIt(?YourControlGoesHere)
NOTE: Entry control has to be FLAT
Sample screenshot
It looks good but I can’t get round corner at entry field.
Test.zip (1.8 KB)
Thanks anyway
Looks like the Zip is corrupted… I am not able to open it… Can you please re-attach it for me.
Thanks
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.
Here it is againtest.zip (14.8 KB)
Try Icetips magicentries. Allows rounded entry fields and defines global colours for required, read-only etc.