FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to define second Item in Combobox?
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
How to define second Item in Combobox?
Posted: Tue Apr 27, 2010 02:45 PM

Hi

I have a Combobox, aItem { "A", "B", "C", "D" } in Resource Dialog.
How to set Second Item "B" when I start Resource Dialog?
Because I alwayse get First Item "A"

Thanks

Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: How to define second Item in Combobox?
Posted: Tue Apr 27, 2010 04:14 PM
That's easy.

Code (fw): Select all Collapse
LOCAL aItem := {"A","B","C","D"}

LOCAL cTest := 2 // Initially second item of array is selected

DEFINE DIALOG oDlg .....
......
REDEFINE COMBOBOX cTest ITEMS aItem ID 101 OF oDlg STYLE CBS_DROPDOWN
......
When the dialog box is opened, the combobox will show you "B" automatically.

Good luck.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to define second Item in Combobox?
Posted: Tue Apr 27, 2010 04:15 PM

cVar = "B"

REDEFINE COMBOBOX oCbx VAR cVar ...

EMG

Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: How to define second Item in Combobox?
Posted: Tue Apr 27, 2010 04:28 PM
Enrico Maria Giordano wrote:cVar = "B"

REDEFINE COMBOBOX oCbx VAR cVar ...

EMG


Hi Michel, EMG,

Thanks a lot. It's work fine.
Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit

Continue the discussion