Jump to content


Photo

TNxRadioButton bug


  • Please log in to reply
4 replies to this topic

#1 array81

array81

    Senior Member

  • Members
  • PipPip
  • 290 posts
  • Gender:Male

Posted 18 September 2011 - 05:52 PM

I have 2 TNXRadioButton on my form. The first is set enabled=FALSE and the second enabled=TRUE, at run time I set enabled=TRUE for first TNxRadioButton, in this way the radio button is enabled but the text is GRAY again, the text should be BLACK not gray.

I thinks this is a bug, can you test it, please.

Thanks

#2 CSE

CSE
  • Members
  • 54 posts
  • Location:Germany

Posted 30 September 2011 - 11:18 AM

Hi, same problem here.
Seems to be a missing Invalidate call when Enable property is changed.
As a workaround you may call Invalidate function of the TNxRadioButton(s) by yourself.
Best regards,
Thomas

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 30 September 2011 - 11:44 AM

Hi,

Please add next code into NxEdit.pas:



protected
procedure CMEnabledChanged(var Message: TMessage);
...

procedure TNxRadioButton.CMEnabledChanged(var Message: TMessage);
begin
  inherited;
  Invalidate;
end;



I hope that now works.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#4 CSE

CSE
  • Members
  • 54 posts
  • Location:Germany

Posted 04 October 2011 - 02:17 PM

Hi Boki,

that did the trick.
Just one small fix of your code, the declaration of the procedure must look like this:
procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED;

Thank you
Best regards,
Thomas

#5 array81

array81

    Senior Member

  • Members
  • PipPip
  • 290 posts
  • Gender:Male

Posted 04 October 2011 - 11:41 PM

I will try it. Thanks.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users