WOW!
Why didn't I think of that?
Thank's DeAnna
"DeAnna Davidson" <[EMAIL PROTECTED]> wrote in message
news:50027@palm-dev-forum...
Hi Mark,
You actually have to set the label for the popup control. Selecting the
item in the list does not affect the label of the pop trigger.
You need to make a CtlSetLabel call with the proper string.
I hope this helps,
DeAnna
-----Original Message-----
From: Mark Douglas [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 21, 2001 3:59 PM
To: Palm Developer Forum
Subject: Selecing Proper Value in PopUp List Box
I have a form that has a popup listbox on it. I wrote the following
function that, given an input string and a ListType *, should select the
item in the popup list that matches the input string. (Seemed Simple).
However when the following function executes. The PopUp Listbox is
displayed with it's label rather than the selected item. I believe the
problem must lie in my use of LstSetSelection, I have tried a myriad of
other Lst functions, but none have given me the desired result.
Has anyone else run into and/or conquered this problem?
Mark Douglas
Boolean ListSetSelectedItemFromValue(ListType *listP, Char * pszValue) {
UInt16 usNumItems = 0;
UInt16 i;
Char * pszListItem = NULL;
usNumItems = LstGetNumberOfItems(listP);
for(i = 0; i < usNumItems; i++) {
pszListItem = LstGetSelectionText (listP, i);
if(pszListItem != NULL) {
if(StrCaselessCompare(pszListItem, pszValue) == 0){
LstSetSelection(listP, i);
return true;
}
}
}
return false;
}
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/