1. Dan Cooperstock
  2. PowerBuilder
  3. Monday, 19 July 2021 22:28 PM UTC

I'm using PB2019. I have a window with a radio button on it (not on a DataWindow). When it gets focussed, a weird dotted border appears above and below it. See the attachment.

Does anyone know what causes that, and is there a way to eliminate it? Looks weird.

Thanks.

Attachments (1)
Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 20 July 2021 02:57 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi, Dan - 

A radio button control (not a DW column object using the radio button edit style) is a Windows control, which is drawn (rendered) by Windows, not PB. I'm pretty sure what you are seeing is part of the "input focus" outline that Windows draws around a radio button control when it has focus, as shown below:

Since the rendering of this control is performed by Windows, I doubt you'll be able to change this except by protecting the control and thereby preventing it from receiving input focus.

Regards,
John

Comment
  1. Miguel Leeuwe
  2. Tuesday, 20 July 2021 09:31 AM UTC
Hi John,

If you'd "protect" the control (using the protect attribute), wouldn't that make it impossible to change the value?

regards. Or maybe you're saying to set the taborder to 0 and coding the clicked() event?

regards.
  1. Helpful
  1. Andreas Mykonios
  2. Tuesday, 20 July 2021 11:29 AM UTC
Hi Miguel.

I don't believe that John refers to the protect attribute, as this one exists for datawindow controls.

Standart controls can be "protected" by making them disabled or by removing the tab as you mentioned.



Andreas.
  1. Helpful
  1. Miguel Leeuwe
  2. Tuesday, 20 July 2021 12:04 PM UTC
Ah okay, I should wear my glasses! John clearly states it...

thanks for clearing that up Andreas.

regards
  1. Helpful
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Tuesday, 20 July 2021 08:06 AM UTC
  2. PowerBuilder
  3. # 1

Hi Dan.

One workaround is to remove the text from your checkbox - radiobutton control and resize it to use only the space it takes without text. Then add a static text with the appropriate text. I understand this is a huge change, especially if you have to make that change to many controls. But you could create a custom visual object to make this easier. Then you would have to change the "type rb_xxxx from radiobutton" to something else (the name of your custom visual object).

Depending on the events - properties you currently use and the one defined in your custom visual object this could be easier or harder.

Also, take in mind that there is a difference if you split text from checkbox or radiobutton to a static text. Normally a radio button or a checkbox will be selected (checked) even if you click on the text (that's why you see that rectangle). But if you want that to happen with a custom visual object built with a radio button and a static text, you will have to implement that logic by your self.

That's a very generic description of the workaround I have in mind.

Andreas.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.