FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Question about ComboBox
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Question about ComboBox
Posted: Thu Aug 03, 2017 08:40 PM
Hi Guys,

Do you know if is possible to do a combobox with the lenght of area (2)(see image) bigger than area (1) ?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Question about ComboBox
Posted: Thu Aug 03, 2017 08:45 PM

Wider?

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Question about ComboBox
Posted: Thu Aug 03, 2017 08:49 PM

Yes !

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Question about ComboBox
Posted: Thu Aug 03, 2017 10:13 PM
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oWnd, oCbx
   local aItems   := { "One", "Two", "Three" }
   local nItem    := 1

   DEFINE WINDOW oWnd

   @ 60, 20 COMBOBOX oCbx VAR nItem ITEMS aItems SIZE 100,400 PIXEL OF oWnd
   oCbx:SendMsg( 0x160, 250, 0 )
   @ 60,300 BUTTON "OK" SIZE 60,30 PIXEL OF oWnd

   ACTIVATE WINDOW oWnd CENTERED

return nil


Regards



G. N. Rao.

Hyderabad, India
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Question about ComboBox
Posted: Thu Aug 03, 2017 10:33 PM

Mr Rao,

Thank you :)

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Re: Question about ComboBox
Posted: Sat Aug 05, 2017 01:53 AM
Mr Rao
How to change combobox top area size at runtime ?

TKS!
Shuming Wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Question about ComboBox
Posted: Sat Aug 05, 2017 03:41 PM

Do you mean height?
While creating, you can use clause HEIGHTGET nHeight.
Do you want to change at runtime? May I know why?

Regards



G. N. Rao.

Hyderabad, India
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Re: Question about ComboBox
Posted: Mon Aug 07, 2017 02:36 AM
...
activate dialog odlg on init resize(odlg)

function resize(odlg,res)
rsl0:=getsysmetrics(0)/res //width,col

if rsl0<>1;

//<=800*600, not needed

rsl1:=getsysmetrics(1)/if(res==800,600,768) //base height ,nrow
for i:=1 TO LEN(::acontrols)
oCtrol = odlg:aControls[i] // top:nrow, left:ncol,bottom: nrow, right:ncol
aRect = GetCoors( oCtrol:hWnd )
do case
case oCtrol:classname()=="TCOMBOBOX"
oCtrol:Move( aRect[1]*rsl1, aRect[2]*rsl0 )
// cant not set height of combobox : oget height,listbox height
otherwise
oCtrol:Move( aRect[1]*rsl1, aRect[2]*rsl0,(aRect[4] - aRect[2])*rsl0, (aRect[3] - aRect[1])*rsl1, .t. )
// ntop,nleft,nbottom,nright
end case
next
endif

return
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Question about ComboBox
Posted: Mon Aug 07, 2017 08:48 AM
Code (fw): Select all Collapse
SendMessage( oCbx:hWnd, 0x0153, -1, nNewHeight )
Regards



G. N. Rao.

Hyderabad, India
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Question about ComboBox
Posted: Mon Aug 07, 2017 10:21 AM

I found, sendmessage(..) must be on the ON INIT clausula from the dialog.

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Question about ComboBox
Posted: Tue Aug 08, 2017 12:21 AM
byte-one wrote:I found, sendmessage(..) must be on the ON INIT clausula from the dialog.

Yes, ofcourse.
In case of dialog hWnd gets a value only ON INIT.
Regards



G. N. Rao.

Hyderabad, India
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Re: Question about ComboBox
Posted: Thu Aug 10, 2017 04:20 AM

Works fine!
Thank you MR Rao!
Shuming Wang

http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Re: Question about ComboBox
Posted: Thu Aug 17, 2017 07:15 AM
Mr Rao,
A small problem with SendMessage( oCbx:hWnd, 0x0153, -1, nNewHeight ),combobox be blue colored background on init .

Regards!
Shuming Wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651

Continue the discussion