Just a quick one,
How do I remove the border from a radio button and checkbox control?
Can't seem to find an example.
Thanks,
Andy.
Have you tried to use pcSetBorderSize?
Egil,
I can't find any reference to it, I might have to change them to buttons, but thanks.
Andy.
Seems like my memory tricked me a bit..... sorry!
My suggestion only works with Pager Controls.
Can you show me a screenshot of what you are talking about and the code you used to generate both of them?
Larry,
It's just a simple window, background (black) and the controls (yellow).
When the radiobutton is selected it has a yellow border (which I'm trying to get rid of) around the text of the control e.g. Yes.
window dy2
OPENWINDOW dy2,100,100,400,400,@CAPTION|@MINBOX|@MAXBOX|@TOPMOST,0," Please confirm.",&confirmhnd
FLOODFILL dy2,0,0,rgb(0,0,0)
CONTROL dy2,@RADIOBUTTON,"Yes",150,140,80,25,@TABSTOP,1
CONTROL dy2,@RADIOBUTTON,"No",150,180,80,25,@TABSTOP,2
CONTROL dy2,@STATIC,"Are you sure you want to delete all entries?",0,70,400,25,@CTEDITCENTER,3
SETCONTROLCOLOR dy2,1,rgb(255,255,100),rgb(0,0,0)
SETCONTROLCOLOR dy2,2,rgb(255,255,100),rgb(0,0,0)
SETCONTROLCOLOR dy2,3,rgb(255,255,100),rgb(0,0,0)
SETFONT dy2,"Arial",12,500,0,1
SETFONT dy2,"Arial",12,500,0,2
SETFONT dy2,"Arial",12,500,0,3
enabletabs dy2,1
setfocus dy2,1
WAITUNTIL dy2=0
end
SUB ConfirmHnd(),int 'Confirm screen handler
SELECT @MESSAGE
case @IDCREATE
CENTERWINDOW dy2
CASE @IDCONTROL
SELECT @CONTROLID
ENDSELECT
CASE @IDCLOSEWINDOW
closewindow dy2
end
ENDSELECT
RETURN 0
ENDSUB
Sorry I can't do a screen shot.
I've been playing around with WS_EX_CLIENTEDGE and WS_BORDER but can't find what I need.
Thanks.
Andy,
When compiling your code the only "border" I see is the dotted line around the word "Yes".
That line is indicating that the control has focus.
If you delete the line saying "setfocus dy2,1", the dotted line dissapears. ;D
Egil,
That's right, but when a user selects the radio button the yellow dots come back, and it's these dots I'm trying to get rid of.
Andy.
Make a dummy control, and give that control focus as soon as one of the others is selected:
window dy2
OPENWINDOW dy2,100,100,400,400,@CAPTION|@MINBOX|@MAXBOX|@TOPMOST,0," Please confirm.",&confirmhnd
FLOODFILL dy2,0,0,rgb(0,0,0)
CONTROL dy2,@RADIOBUTTON,"Yes",150,140,80,25,@TABSTOP,1
CONTROL dy2,@RADIOBUTTON,"No",150,180,80,25,@TABSTOP,2
CONTROL dy2,@STATIC,"Are you sure you want to delete all entries?",0,70,400,25,@CTEDITCENTER,3
' ** DUMMY CONTROL **
CONTROL dy2,@STATIC,"",0,0,1,1,0,4
SETCONTROLCOLOR dy2,1,rgb(255,255,100),rgb(0,0,0)
SETCONTROLCOLOR dy2,2,rgb(255,255,100),rgb(0,0,0)
SETCONTROLCOLOR dy2,3,rgb(255,255,100),rgb(0,0,0)
SETFONT dy2,"Arial",12,500,0,1
SETFONT dy2,"Arial",12,500,0,2
SETFONT dy2,"Arial",12,500,0,3
enabletabs dy2,1
WAITUNTIL dy2=0
end
SUB ConfirmHnd(),int 'Confirm screen handler
SELECT @MESSAGE
case @IDCREATE
CENTERWINDOW dy2
CASE @IDCONTROL
SELECT @CONTROLID
case 1
setfocus dy2,4
case 2
setfocus dy2,4
ENDSELECT
CASE @IDCLOSEWINDOW
closewindow dy2
end
setfocus dy2,4
ENDSELECT
RETURN 0
ENDSUB
Maybe not just what you wanted, but it works.
Thanks Egil that's a solution, but I just realised that by making the radio button text empty and having a static with the text next to it works well (at least for me).
window dy2
OPENWINDOW dy2,100,100,400,400,@CAPTION|@MINBOX|@MAXBOX|@TOPMOST,0," Please confirm.",&confirmhnd
FLOODFILL dy2,0,0,rgb(0,0,0)
CONTROL dy2,@RADIOBUTTON,"",150,140,15,25,@TABSTOP,1
CONTROL dy2,@RADIOBUTTON,"",150,180,15,25,@TABSTOP,2
CONTROL dy2,@STATIC,"Yes",172,143,80,25,@TABSTOP,4
CONTROL dy2,@STATIC,"No",172,183,80,25,@TABSTOP,5
CONTROL dy2,@STATIC,"Are you sure you want to delete all entries?",0,70,400,25,@CTEDITCENTER,3
SETCONTROLCOLOR dy2,1,rgb(255,255,100),rgb(0,0,0)
SETCONTROLCOLOR dy2,2,rgb(255,255,100),rgb(0,0,0)
SETCONTROLCOLOR dy2,3,rgb(255,255,100),rgb(0,0,0)
SETCONTROLCOLOR dy2,4,rgb(255,255,100),rgb(0,0,0)
SETCONTROLCOLOR dy2,5,rgb(255,255,100),rgb(0,0,0)
SETFONT dy2,"Arial",12,500,0,1
SETFONT dy2,"Arial",12,500,0,2
SETFONT dy2,"Arial",12,500,0,3
SETFONT dy2,"Arial",12,500,0,4
SETFONT dy2,"Arial",12,500,0,5
enabletabs dy2,1
setfocus dy2,1
WAITUNTIL dy2=0
end
SUB ConfirmHnd(),int 'Confirm screen handler
SELECT @MESSAGE
case @IDCREATE
CENTERWINDOW dy2
CASE @IDCONTROL
SELECT @CONTROLID
ENDSELECT
CASE @IDCLOSEWINDOW
closewindow dy2
end
ENDSELECT
RETURN 0
ENDSUB
That's sounds like a much better solution!