How to define second Item in Combobox?

How to define second Item in Combobox?

Postby richard-service » Tue Apr 27, 2010 2: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 (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: How to define second Item in Combobox?

Postby driessen » Tue Apr 27, 2010 4:14 pm

That's easy.

Code: Select all  Expand view
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.
Last edited by driessen on Tue Apr 27, 2010 4:15 pm, edited 1 time in total.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: How to define second Item in Combobox?

Postby Enrico Maria Giordano » Tue Apr 27, 2010 4:15 pm

cVar = "B"

REDEFINE COMBOBOX oCbx VAR cVar ...

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: How to define second Item in Combobox?

Postby richard-service » Tue Apr 27, 2010 4: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 (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 51 guests