October 30, 2025, 12:58:17 PM

News:

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


Full border around a checkbox / edit box etc

Started by Andy, July 14, 2013, 04:13:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

Hi,

I can't find an example of how to make a checkbox or edit box show a full border around it.

Example:

CONTROL dy,@EDIT,"",150,65,500,30,0x50810000,600

This gives an outline (left vertical) and (Top horizontal), but bottom horizontal and right vertical are not highlighted.

How do I change the above example so that all four lines are highlighted, i.e. it shows a box?

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

Brian

Well, you could add in the WS_BORDER constant, which is 0x00800000
but an edit box with the constant, and one without, look just the same to me!

So your line would be:

CONTROL dy,@EDIT,"",150,65,500,30,0x50810000|0x00800000,600

Brian

Andy

Thanks Brian,

Sorry, that didn't work but I'm always thankful for any help or suggestions.

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

LarryMc

I think the best you can do without drawing the edit control yourself is

CONTROL dy,@EDIT,"",150,65,500,30,0x50410000,600
and then using the MODIFYEXSTYLE command to remove the 0x200 exstyle

If the edit control is on a window you can draw your own rectangle around the edit control.

As for a check box.  The outline of a checkbox includes the area around the text so if you are wanting to change the look of the little box itself you'll have to draw it yourself.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

Larry,
You know, I keep forgetting about the richness of the commands that are available to us
in this language - forgot all about MODIFYEXSTYLE

Andy,
This works for me (alter params to suit):

CONTROL d1,@EDIT,"Edit",35,120,186,20,0x50800000,600
CONST WS_EX_CLIENTEDGE=0x200
MODIFYEXSTYLE d1,0,WS_EX_CLIENTEDGE,600
REDRAWFRAME d1,600

Brian

Andy

Brian,

That's perfect!

Thanks so much, you still walking along those canals?

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

Brian

Andy,
How did you remember that! Yes, we still have the walks, although I'm struggling at the moment
with arthritic hips and knees, so we don't go just as far. Glad that helped
Brian