ScriptSpot

Forum topic · General Scripting

dotNetControl TextBox lost text formating when change enabled state.

By Romeh · 2013-08-12

Description

hello,

I actually trying tu use the dotnet Textbox, But i encounter a problem, when i change his enabled state, the TextBox lost text formating, As you can see in the short code bellow.

Do you know an alternative that can keep formatting when textbox is disable? (or may be i made a mistake..)

Thanks


rollout rolTest "Test"
(
dotNetControl custtxt "System.Windows.Forms.TextBox" pos:[16,25] width:240 height:144
checkbox actcc "active/desactive" pos:[17,200] width:232 height:16 checked:false

on rolTest open do (
custtxt.Multiline = true;
custtxt.ScrollBars = custtxt.ScrollBars.vertical;
custtxt.text = "blzaezijfnai afarfijnazf \r\n DFZAFEAZFd"

)
on actcc changed theState do (
if actcc.checked == true then ( custtxt.enabled = false )
else ( custtxt.enabled = true )
)
)

createDialog rolTest 400 400

Comments (4)

barigazy · 2013-08-12

Yep. This is the thing with .net. Instead of "Enable" propertie you can use "ReadOnly" if you want to preserve formatting.
BTW is not only the problem with textbox, also others ctrls where you can edit text or some values have same problem.

Romeh · 2013-08-12

thanks