Page 1 of 1

Deactivate change of the background colour if ReadOnly=tru

Posted: 15 Jul 2009, 13:03
by Natorion
Hi,

if I set ReadOnly=true the EditBox gets a grey background. I want to have the background have another colour. Using:

Code: Select all

EditBoxControlInstance.BackColor = &HFF0000
has absolutly no effect. How do I alter the background?

Re: Deactivate change of the background colour if ReadOnly=tru

Posted: 15 Jul 2009, 15:41
by TiKu
You would need subclassing to change this color.

How urgent do you need a solution? I'm in the progress of updating some parts of EditControls and could implement a new property called "DisabledBackColor" or something like that. The problem is, that I do not have much time to work on the controls, so 2 weeks could pass before I can release the update.

Re: Deactivate change of the background colour if ReadOnly=tru

Posted: 16 Jul 2009, 07:08
by Natorion
Thank you, two weeks are enough for me ;)

What exactly do you mean with subclassing in this context?

Re: Deactivate change of the background colour if ReadOnly=tru

Posted: 16 Jul 2009, 08:16
by TiKu
Natorion wrote:What exactly do you mean with subclassing in this context?
The WM_CTLCOLORSTATIC message that is sent to the control's parent window must be handled.

Re: Deactivate change of the background colour if ReadOnly=tru

Posted: 16 Jul 2009, 11:44
by Natorion
I now tried to intercept the which fires when the text is changed so I can nullify the change. Unfortunatly there is no such event :/

Re: Deactivate change of the background colour if ReadOnly=tru

Posted: 16 Jul 2009, 15:57
by TiKu
Sounds like you're looking for the TextChanged event.

Re: Deactivate change of the background colour if ReadOnly=tru

Posted: 21 Jul 2009, 08:28
by Natorion
Unfortanatly TextChanged fires after the change and with no parameters. I have done a workaraound now, wrapping the whole text changing ;)

Re: Deactivate change of the background colour if ReadOnly=tru

Posted: 25 Sep 2009, 14:00
by itmg
Hi,

what I'm doing wrong?
The backcolor of the text should be red also!

Re: Deactivate change of the background colour if ReadOnly=tru

Posted: 25 Sep 2009, 15:06
by TiKu
Looks like version 1.4.0 introduced several drawing issues. Please try the attached version.

Re: Deactivate change of the background colour if ReadOnly=tru

Posted: 25 Sep 2009, 15:27
by itmg
Thanks!
That was quick! :D