|
Post by wexhammer on Jan 18, 2020 8:29:14 GMT -5
For some reason my textbox wont change colour when clicking my button programmed to turn the textbox blue.
'** Created by Liberty BASIC Workshop - 18/01/2020 13:25:52 '** ChangeColour
True = 1 : False = 0
[WindowSetup] NOMAINWIN WindowWidth = 241 : WindowHeight = 116 UpperLeftX = INT((DisplayWidth-WindowWidth)/2) UpperLeftY = INT((DisplayHeight-WindowHeight)/2)
[ControlSetup] stylebits #main.change, _BS_MULTILINE, 0, 0, 0 button #main.change, "Turn Blue", [blue], UL, 10, 40, 205, 25 TextboxColor$ = "Red" textbox #main.red, 10, 10, 205, 24
Open "ChangeColour" for Window as #main #main "trapclose [quit]" #main "font ms_sans_serif 10"
[loop] Wait
[quit] close #main : END
[blue] TextboxColor$ = "blue" textbox #main.red, 10, 10, 205, 24 wait
|
|
|
Post by Rod on Jan 18, 2020 9:24:10 GMT -5
The textbox color can only be set when the control is created. What you can do is create two and show and hide. You would need to move the text content from one to the other as well.
True = 1 : False = 0
[WindowSetup] NOMAINWIN WindowWidth = 241 : WindowHeight = 116 UpperLeftX = INT((DisplayWidth-WindowWidth)/2) UpperLeftY = INT((DisplayHeight-WindowHeight)/2)
[ControlSetup] stylebits #main.change, _BS_MULTILINE, 0, 0, 0 button #main.change, "Turn Blue", [blue], UL, 10, 40, 205, 25 TextboxColor$ = "Red" textbox #main.red, 10, 10, 205, 24 TextboxColor$="blue" textbox #main.blue, 10, 10, 205, 24
Open "ChangeColour" for Window as #main #main "trapclose [quit]" #main "font ms_sans_serif 10" #main.blue "!hide"
[loop] Wait
[quit] close #main : END
[blue] #main.red "!hide" #main.blue "!Show" wait
|
|