I iCAB Well-Known Member Licensed User Longtime User Oct 31, 2011 #1 Hi Guys I am new to Basic4Android and I would realy appreciate some help. I am looking at 2 sample codes TabHostExtra & ScrollViewExample. I would like to be able to use a combination of the 2 examples in a way to display in each table a scroll view. My question is how to add the scroll views dynamically to each Tab and how to address them properly in code properly. My Other question is: in Activity_Create of the TabHostExtraDemo you use Button1.Tag = 1; How does the compiler know which button1 you are addressing ( The one on the first Tab, or the second Tab ). can someone please clarify Thank you
Hi Guys I am new to Basic4Android and I would realy appreciate some help. I am looking at 2 sample codes TabHostExtra & ScrollViewExample. I would like to be able to use a combination of the 2 examples in a way to display in each table a scroll view. My question is how to add the scroll views dynamically to each Tab and how to address them properly in code properly. My Other question is: in Activity_Create of the TabHostExtraDemo you use Button1.Tag = 1; How does the compiler know which button1 you are addressing ( The one on the first Tab, or the second Tab ). can someone please clarify Thank you
klaus Expert Licensed User Longtime User Oct 31, 2011 #2 You should have a look at this example: TabHostScrollViews. There is no problem with the Button1.Tag, the name of the Button doesn't matter. In the Button1_Click routine the Sender object holds the reference to the Button that raised the event. Best regards. Upvote 0
You should have a look at this example: TabHostScrollViews. There is no problem with the Button1.Tag, the name of the Button doesn't matter. In the Button1_Click routine the Sender object holds the reference to the Button that raised the event. Best regards.
I iCAB Well-Known Member Licensed User Longtime User Oct 31, 2011 #3 Hi Klaus Thanks for the reply. Great help. The only thing that I am still looking for is how can I headers to the scroll views similar to the ScrollViewExample. Also when I mentioned about Button1, I was referring to the this part of the code ( there is no sender in here ). Can you please clarify For i=0 To TabCount-1 If i=0 Then TabHost1.AddTab("Tab#"&i, "LayoutWebView") WebView1.LoadUrl("http://www.google.co.uk/") Else TabHost1.AddTab("Tab#"&i, "LayoutTabContent") Button1.Tag=i If TabsEnabled(i) Then Button1.Text="Disable this tab" Else Button1.Text="Enable this tab" End If EnableButtons(i)=Button1 Button2.Tag=i If TabsVisibility(i) Then Button2.Text="Hide this tab" Else Button2.Text="Show this tab" End If ShowHideButtons(i)=Button2 Edittext1.Text=TabHeight Label1.Text="This is TabContent #"&i End If Next Thanks for all the help Upvote 0
Hi Klaus Thanks for the reply. Great help. The only thing that I am still looking for is how can I headers to the scroll views similar to the ScrollViewExample. Also when I mentioned about Button1, I was referring to the this part of the code ( there is no sender in here ). Can you please clarify For i=0 To TabCount-1 If i=0 Then TabHost1.AddTab("Tab#"&i, "LayoutWebView") WebView1.LoadUrl("http://www.google.co.uk/") Else TabHost1.AddTab("Tab#"&i, "LayoutTabContent") Button1.Tag=i If TabsEnabled(i) Then Button1.Text="Disable this tab" Else Button1.Text="Enable this tab" End If EnableButtons(i)=Button1 Button2.Tag=i If TabsVisibility(i) Then Button2.Text="Hide this tab" Else Button2.Text="Show this tab" End If ShowHideButtons(i)=Button2 Edittext1.Text=TabHeight Label1.Text="This is TabContent #"&i End If Next Thanks for all the help
klaus Expert Licensed User Longtime User Oct 31, 2011 #4 The only thing that I am still looking for is how can I headers to the scroll views similar to the ScrollViewExample. Click to expand... You have everything you need in the ScrollViewExample. Or have a look at this example. Also when I mentioned about Button1, I was referring to the this part of the code ( there is no sender in here ). Can you please clarify Click to expand... I know that in the code fragment you are refering to there is no Sender keyword. In this code fragment the name of the buttons are those defined in the layout file. But each time the layout file is loaded, new instances of Button1 and Button2 are initiated and the previous names are no longer known by the system but they are known with an internal reference. All Button1 buttons have the same event routine. For example, in the event routine Button1_Click you need to know what Button raised the event and here the reference is given by the Sender object. Best regards. Upvote 0
The only thing that I am still looking for is how can I headers to the scroll views similar to the ScrollViewExample. Click to expand... You have everything you need in the ScrollViewExample. Or have a look at this example. Also when I mentioned about Button1, I was referring to the this part of the code ( there is no sender in here ). Can you please clarify Click to expand... I know that in the code fragment you are refering to there is no Sender keyword. In this code fragment the name of the buttons are those defined in the layout file. But each time the layout file is loaded, new instances of Button1 and Button2 are initiated and the previous names are no longer known by the system but they are known with an internal reference. All Button1 buttons have the same event routine. For example, in the event routine Button1_Click you need to know what Button raised the event and here the reference is given by the Sender object. Best regards.
I iCAB Well-Known Member Licensed User Longtime User Nov 2, 2011 #5 Hi Klaus Thanks for all the help. I am having problem getting the scroll view to scroll. Is it possible for me to e-mail you a zip file for the project ( it is very small ). Please let me know Thanks Upvote 0
Hi Klaus Thanks for all the help. I am having problem getting the scroll view to scroll. Is it possible for me to e-mail you a zip file for the project ( it is very small ). Please let me know Thanks
klaus Expert Licensed User Longtime User Nov 2, 2011 #6 No problem. I sent you a PM with my private e-mail adress. Best regards. Last edited: Nov 2, 2011 Upvote 0
I iCAB Well-Known Member Licensed User Longtime User Nov 2, 2011 #7 I just e-mailed you the Zip File. Thanks a lot for all the great help Upvote 0
klaus Expert Licensed User Longtime User Nov 3, 2011 #8 You should have got an e-mail with an updated version. Best regards. Upvote 0
I iCAB Well-Known Member Licensed User Longtime User Nov 4, 2011 #9 Thank you It works great Upvote 0
I iCAB Well-Known Member Licensed User Longtime User Nov 5, 2011 #10 Hi Klaus Is there a way to change the background and Foreground Colors for the current Tab? Thanks Upvote 0
klaus Expert Licensed User Longtime User Nov 5, 2011 #11 Is there a way to change the background and Foreground Colors for the current Tab? Click to expand... What colors do you want to change ? The colors of the colors in the ScrollViews ? The ScrollView colors can be chaged with: Code: Copy svcViewsGUIParm(0).CellColor = Colors.RGB(255,255,220) svcViewsGUIParm(0).FontColor = Colors.Red svcViewsGUIParm(0).LineColor = Colors.Blue Best regards. Upvote 0
Is there a way to change the background and Foreground Colors for the current Tab? Click to expand... What colors do you want to change ? The colors of the colors in the ScrollViews ? The ScrollView colors can be chaged with: Code: Copy svcViewsGUIParm(0).CellColor = Colors.RGB(255,255,220) svcViewsGUIParm(0).FontColor = Colors.Red svcViewsGUIParm(0).LineColor = Colors.Blue Best regards.
I iCAB Well-Known Member Licensed User Longtime User Nov 11, 2011 #12 Sorry, I didn't see your reply before. I didn't notice that there is Next Page on the forum. Thank you for the reply Upvote 0
Sorry, I didn't see your reply before. I didn't notice that there is Next Page on the forum. Thank you for the reply