PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Combo - Show default value
Combo - Show default value
Started by derek.theobald, Jun., 27 2003 3:45 AM - 2 replies
Posted on June, 27 2003 - 3:45 AM
Hi
I'm using the selected value of a Combo Box to filter the records displayed in a table (Display Only)
The initial table view is All records therefore I needed to add an additional item to the list < All >
The Combo is populated with data from a datafile
I have tried populating the Combo by linking to the file and specifiying a 1st custom row as < All >
and by programming using ListAdd with ListInsert for < All >
Both methods work fine with < All > the first item on the list
What I cannot achieve is getting the Combo to display this value when the window opens
Tried loads of different functions but all I get is the standard empty first line or compile errors
complaining that the control is read only
How do I get the word to appear in the Combo when the window is opened
Regards
DT
Posted on June, 28 2003 - 7:58 AM
G'day DT
In 5.5 the following commands would force a combo box to open with the window.
They may also work with 7.5
//This code is a segment from a larger proc
//BoxToOpen is the combobox name
BoxToOpen = Myself..name
SendMessage(Handle(BoxToOpen), 513, 0, NULL)
SendMessage(Handle(BoxToOpen), 514, 0, NULL)
SendMessage(Handle(BoxToOpen), 1039, 1, NULL)

Regards
Al
Posted on June, 29 2003 - 5:42 PM
Hi
I'm using the selected value of a Combo Box to filter the records displayed in a table (Display Only)
The initial table view is All records therefore I needed to add an additional item to the list < All >
The Combo is populated with data from a datafile
I have tried populating the Combo by linking to the file and specifiying a 1st custom row as < All > and by programming using ListAdd with ListInsert for < All >
Both methods work fine with < All > the first item on the list
What I cannot achieve is getting the Combo to display this value when the window opens
Tried loads of different functions but all I get is the standard empty first line or compile errors complaining that the control is read only
How do I get the word to appear in the Combo when the window is opened
Regards
DT

Hi DT,
I hope you use WD 7.5 because this is for WD75.
In you program I guess you "added" or "inserted" the special option "ALL" as the "first" option in your Combo-selection list, say with index "1".
I guess you coded this in the Initialing section of the combo, or in the "End of Init"-section of the Combo if it was "file-linked".
Now in the "Initialization-Section of your WINDOW-code" put the code:
ListSelectPlus(comboname,1)
(If "ALL"-option sits as "first" choice in your Combo.)
If your ALL was "added at the end", then you state:
ListSelectPlus(comboname,comboname..occurrence)
Succes,
Lieven De Nys, member of the Benelux Windevgroup.