Deactivate change of the background colour if ReadOnly=tru

The place for threads about TimoSoft EditControls.
Post Reply
Natorion
Lieutenant
Posts: 14
Joined: 12 Jan 2009, 10:35

Deactivate change of the background colour if ReadOnly=tru

Post 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?
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

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

Post 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.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Natorion
Lieutenant
Posts: 14
Joined: 12 Jan 2009, 10:35

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

Post by Natorion »

Thank you, two weeks are enough for me ;)

What exactly do you mean with subclassing in this context?
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

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

Post 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.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Natorion
Lieutenant
Posts: 14
Joined: 12 Jan 2009, 10:35

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

Post 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 :/
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

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

Post by TiKu »

Sounds like you're looking for the TextChanged event.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Natorion
Lieutenant
Posts: 14
Joined: 12 Jan 2009, 10:35

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

Post by Natorion »

Unfortanatly TextChanged fires after the change and with no parameters. I have done a workaraound now, wrapping the whole text changing ;)
User avatar
itmg
Lieutenant
Posts: 13
Joined: 14 Jul 2009, 12:04

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

Post by itmg »

Hi,

what I'm doing wrong?
The backcolor of the text should be red also!
Attachments
textbox_backcolor.jpg
(55.99 KiB) Not downloaded yet

ButtonControls 1.4 Unicode
EditControls 1.4 Unicode
DateTimeControls 1.1 Unicode
Statusbar 1.2 Unicode
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

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

Post by TiKu »

Looks like version 1.4.0 introduced several drawing issues. Please try the attached version.
Attachments
Release - Unicode.zip
EditControls 1.4.1 pre-release
(293.52 KiB) Downloaded 393 times
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
User avatar
itmg
Lieutenant
Posts: 13
Joined: 14 Jul 2009, 12:04

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

Post by itmg »

Thanks!
That was quick! :D

ButtonControls 1.4 Unicode
EditControls 1.4 Unicode
DateTimeControls 1.1 Unicode
Statusbar 1.2 Unicode
Post Reply