tabhost tab image

Rusty

Well-Known Member
Licensed User
Longtime User
I would like to change a tabhost tab image programatically. I've tried

Dim BG As Bitmap
bg.Initialize(File.DirAssets, "Done.png")
tabhost1.CurrentTab = 1
tabhost1.SetBackgroundImage(bg)

this changes the whole tabhost background. Any suggestions. I would like to do this to be able to change the tab image based upon completion of tasks within each tab.
Thanks,
 

Rusty

Well-Known Member
Licensed User
Longtime User
Tab image change

Thanks, Erel.
I was able to add the image to the tab "form", but I want to add/change the "icon" or image within the actual tab itself, not the body of the tab "form". Any suggestions. (for example, in your tabhost1 example you show a microphone within the tab, I'd like to be able to dynamically change this image) Thanks
 
Upvote 0

gapi

Active Member
Licensed User
Longtime User
Instead of using AddTab you should use AddTab2 and add a panel.
You can load the layout file to this panel.
Later you will be able to change the panels backgrounds.

Hi Erel I use AddTab2 with panel inside, now how can change tabHost background color ? It's orange ... I tried with this code:
B4X:
TabHost1.AddTabWithIcon2("", bmp3, bmp4, Panel1)
TabHost1.AddTabWithIcon2("", bmp5, bmp6, Panel1)
TabHost1.Color = Colors.RGB(0,153,204)

become blue on board and orange inside !!!

tnx
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…