G gkumar Active Member Licensed User Longtime User Jun 13, 2012 #1 I have one button with different bitmaps as background, one in normal state and one for button click. But I want to change the text color when the button is clicked. Is there any way to achieve this?
I have one button with different bitmaps as background, one in normal state and one for button click. But I want to change the text color when the button is clicked. Is there any way to achieve this?
thedesolatesoul Expert Licensed User Longtime User Jun 13, 2012 #2 Do a search for statelistdrawable or colorlistdrawable. Sent from my GT-I9000 using Tapatalk 2 Upvote 0
pluton Active Member Licensed User Longtime User Jun 13, 2012 #3 gkumar said: I have one button with different bitmaps as background, one in normal state and one for button click. But I want to change the text color when the button is clicked. Is there any way to achieve this? Click to expand... Code: ' Button text color in blue button1.TextColor = colors.Blue Or did you mean in Button Properties in designer Upvote 0
gkumar said: I have one button with different bitmaps as background, one in normal state and one for button click. But I want to change the text color when the button is clicked. Is there any way to achieve this? Click to expand... Code: ' Button text color in blue button1.TextColor = colors.Blue Or did you mean in Button Properties in designer
G gkumar Active Member Licensed User Longtime User Jun 13, 2012 #4 I wanted to change the text color through the designer. But no option in the designer. But I tried to change the text color by code in the button click event, but it didn't change. Upvote 0
I wanted to change the text color through the designer. But no option in the designer. But I tried to change the text color by code in the button click event, but it didn't change.
Erel B4X founder Staff member Licensed User Longtime User Jun 13, 2012 #5 Try this: Code: Sub Button1_Down Button1.TextColor = Colors.Yellow End Sub Sub Button1_Up Button1.TextColor = Colors.Red End Sub It may not work on versions prior to v1.92. Upvote 0
Try this: Code: Sub Button1_Down Button1.TextColor = Colors.Yellow End Sub Sub Button1_Up Button1.TextColor = Colors.Red End Sub It may not work on versions prior to v1.92.
G gkumar Active Member Licensed User Longtime User Jun 13, 2012 #6 That worked, But there is slight mismatch in display time, as I am changing text color in _Down and bitmap through designer. Upvote 0
That worked, But there is slight mismatch in display time, as I am changing text color in _Down and bitmap through designer.
Erel B4X founder Staff member Licensed User Longtime User Jun 13, 2012 #7 There is another solution available online based on ColorStateList. Try to search for it. I do not know if the timing will be different or not. Another option is to embed the text in the bitmaps. Upvote 0
There is another solution available online based on ColorStateList. Try to search for it. I do not know if the timing will be different or not. Another option is to embed the text in the bitmaps.