PDA

View Full Version : NewB - Adding a tab with Tab_Add


plinydogg
10-27-2006, 12:41 AM
Hi people,

I'm back with another newbie question...I do my best to start the title of each thread with "NewB" so that you veterans out there won't think I have a good question and get annoyed when I just have another silly newbie question. :)

Here's my question: I'm trying to add a second tab to a tab control. I consulted the help file entry on the Simplified API and concluded that I was supposed to use

proc Tab_Add(tab$, caption$)

to add a new tab. I went into the Visual Form Builder, selected the tab control, clicked on the "Events" tab, and then double-clicked on the "OnCreate" event. Once opened, I added the following line:

second$ = "captionOfSecondTab"
Tab_Add(myTabControlsHandle$, second$);

The program ran, but the second tab's text looked like empty characters (i.e., squares). I tried using a string literal instead:

Tab_Add(myTabControlsHandle$, "captionOfSecondTab");

but got the same result. What am I doing wrong?

As always, thank you for the help :D

kornalius
10-27-2006, 11:53 AM
Hi,

I will double-check this function. Here is a nice trick to add tabs from the PIDE. Edit the Caption properties of the tab control by right-clicking the Caption properties field and select "Edit...". From there enter in as many lines as you want to create tabs.

kornalius
10-27-2006, 12:12 PM
Hi,</p>

I have fixgured out the problem. It was in the SWAPI.PPL and it is fixed.</p>

Attached is the latest SWAPI.PPL file. Unzip it and copy it over to \Program Files\PPL\Lib\ on your PocketPC and the Tab_Add() will work no problem.</p>[br]1161947558_1_FT1070_swapi.zip [/html]

plinydogg
10-27-2006, 01:07 PM
Thanks for the help Kornalius. I did what you suggested and everything works great now! Also, thanks for the tip about adding tabs in the PIDE. Finally, I accidentally replaced the SWAPI file on both my Pocket PC and my Desktop (I misread your instructions the first time). Is this a problem? It didn't seem to be. Again, thanks for your help.

kornalius
10-27-2006, 01:15 PM
The SWAPI.PPL that I attached will work on the PC as well as the PocketPC, don't worry.