Question about ComboBox

Question about ComboBox

Postby vilian » Thu Aug 03, 2017 8: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) ?

Image
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Question about ComboBox

Postby cnavarro » Thu Aug 03, 2017 8: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Question about ComboBox

Postby vilian » Thu Aug 03, 2017 8:49 pm

Yes !
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Question about ComboBox

Postby nageswaragunupudi » Thu Aug 03, 2017 10:13 pm

Code: Select all  Expand view
#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
 


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Question about ComboBox

Postby vilian » Thu Aug 03, 2017 10:33 pm

Mr Rao,

Thank you :)
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Question about ComboBox

Postby ShumingWang » Sat Aug 05, 2017 1:53 am

Mr Rao
How to change combobox top area size at runtime ?
Image
TKS!
Shuming Wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: Question about ComboBox

Postby nageswaragunupudi » Sat Aug 05, 2017 3: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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Question about ComboBox

Postby ShumingWang » Mon Aug 07, 2017 2: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
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: Question about ComboBox

Postby nageswaragunupudi » Mon Aug 07, 2017 8:48 am

Code: Select all  Expand view
SendMessage( oCbx:hWnd, 0x0153, -1, nNewHeight )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Question about ComboBox

Postby byte-one » 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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Question about ComboBox

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Question about ComboBox

Postby ShumingWang » Thu Aug 10, 2017 4: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
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: Question about ComboBox

Postby ShumingWang » Thu Aug 17, 2017 7:15 am

Mr Rao,
A small problem with SendMessage( oCbx:hWnd, 0x0153, -1, nNewHeight ),combobox be blue colored background on init .
Image
Regards!
Shuming Wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 118 guests