Question about ComboBox

Post Reply
User avatar
vilian
Posts: 986
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Question about ComboBox

Post by vilian »

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
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: Question about ComboBox

Post by cnavarro »

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
vilian
Posts: 986
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: Question about ComboBox

Post by vilian »

Yes !
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Question about ComboBox

Post by nageswaragunupudi »

Code: Select all | Expand

#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
vilian
Posts: 986
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: Question about ComboBox

Post by vilian »

Mr Rao,

Thank you :)
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
ShumingWang
Posts: 467
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China
Contact:

Re: Question about ComboBox

Post by ShumingWang »

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
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Question about ComboBox

Post by nageswaragunupudi »

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
ShumingWang
Posts: 467
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China
Contact:

Re: Question about ComboBox

Post by ShumingWang »

...
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
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Question about ComboBox

Post by nageswaragunupudi »

Code: Select all | Expand

SendMessage( oCbx:hWnd, 0x0153, -1, nNewHeight )
Regards

G. N. Rao.
Hyderabad, India
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: Question about ComboBox

Post by byte-one »

I found, sendmessage(..) must be on the ON INIT clausula from the dialog.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Question about ComboBox

Post by nageswaragunupudi »

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
ShumingWang
Posts: 467
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China
Contact:

Re: Question about ComboBox

Post by ShumingWang »

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: 467
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China
Contact:

Re: Question about ComboBox

Post by ShumingWang »

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
Post Reply