|
Post by davidcoker on Feb 26, 2006 8:20:59 GMT -5
Hello Alyce, When working with the tab control from within LBW, the comments suggest using "Hide or Show" for any controls associated with each tab: 'Returns 0-based index of selected tab. Call this routine on a timer 'or from another routine to see which tab is selected. 'Hide or Show controls like buttons that are associated with current tab. Can you point me to an example of how to structure the code for a control(s) associated with the tab control? ...I tried searching the LB forum with no luck, so I figured I'd just bug you here. Your help will be much appreciated! -DC-
|
|
|
Post by Alyce Watson on Feb 26, 2006 9:45:29 GMT -5
Hey Doc,
There are lots of ways you could do it, like having handles of controls in arrays, but the simplest would be a select case.
Pseudo code
[tabClicked] gosub [hideAllControls] 'if you have a single sub that hides everything, you have less code
select case TabIndex
case 1 'statements here to show all controls associated with first tab case 2 'statements here to show all controls associated with second tab case n 'statements here to show all controls associated with nth tab end select
Remember that controls which accept new strings of text, like textboxes, need a ! in front of command strings, while controls like graphicboxes don't.
#1.textbox "!show" #1.graphicbox "show"
-Alyce
|
|
|
Post by davidcoker on Feb 26, 2006 10:13:33 GMT -5
...to date I still haven't done a lot of coding with LB (this may change pretty quickly ), so I wasn't quite sure which way to head with it. Thank you very kindly nice lady, much appreciated! DC
|
|
|
Post by davidcoker on Feb 26, 2006 17:51:26 GMT -5
Boy do I feel particularly stupid. (moreso than usual) This afternoon I started working my way through your LB4 companion guide and found not one, but three very nice samples for the tab control. ...another "doh!" moment for you know who. DC
|
|
|
Post by Alyce Watson on Feb 27, 2006 5:59:59 GMT -5
It would be nice if Liberty BASIC had native access to the common controls, but it does not. Some of these are quite easy to implement by API. Some take more code and are more complicated. The tab strip is one of these, as are listviews and treeviews. Here's a little newsletter article with some tab strip stuff in it: babek.info/libertybasicfiles/lbnews/nl108/tab.htmLBW attempts to make the creation of these API controls as easy as possible by setting up the skeleton, but they still require some creative coding.
|
|