April 30, 2024, 10:31:41 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Borderless Radio and Checkboxes

Started by Andy, September 30, 2017, 08:19:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

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.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

Have you tried to use pcSetBorderSize?
Support Amateur Radio  -  Have a ham  for dinner!

Andy

Egil,

I can't find any reference to it, I might have to change them to buttons, but thanks.

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

Seems like my memory tricked me a bit..... sorry!
My suggestion only works with Pager Controls.
Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

Can you show me a screenshot of what you are talking about and the code you used to generate both of them?
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

October 02, 2017, 12:45:04 AM #5 Last Edit: October 02, 2017, 12:53:06 AM by Andy
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.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

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
Support Amateur Radio  -  Have a ham  for dinner!

Andy

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.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

October 02, 2017, 02:42:09 AM #8 Last Edit: October 02, 2017, 02:44:28 AM by Egil
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.
Support Amateur Radio  -  Have a ham  for dinner!

Andy

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


Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

That's sounds like a much better solution!
Support Amateur Radio  -  Have a ham  for dinner!