Click to See Complete Forum and Search --> : Is easy to use the multi column style with list boxes ?
Braulio
April 28th, 1999, 06:24 AM
Hi,
Today I have seen in the property dialog, that is one style for list boxes called "Multi Column", this style, Allows you to have more that one column in a list box ?, Is easy to use ?, Anybody can give an example of howe can I add one element using this ?
Thanks, Bye !
Braulio
Cesario Simões
April 28th, 1999, 09:26 AM
You need just something like this to set the tabstops:
WORD DlgWidthUnits;
int TabStopList[3];// 3 tabstop=3 columns
DlgWidthUnits = LOWORD (GetDialogBaseUnits()) / 4;
TabStopList[0]=20*DlgWidthUnits; //DM4T1
TabStopList[1]=42*DlgWidthUnits; //DM4T2
TabStopList[2]=64*DlgWidthUnits; //DSIN
SendDlgItemMessage ( IDC_LIST_ESTAGIOS, LB_SETTABSTOPS, 3, (LONG)(LPSTR)TabStopList );//Send a message to your list to set it
More informations? Mail me!
From the lower south of Brazil...
Cesario
Cesario Simões, Jr.
Braulio
April 28th, 1999, 09:52 AM
Hi again !
So every column is separated by a TAB character ( in add string we separate the columns with the tabs ?), and then is needed to calculate the maximum length of one field ?, mmm..., yes I think I need a little bit more of help, Thanks !
Bye !
Braulio
PS.: One Spanish working in Switzerland
Cesario Simões
April 28th, 1999, 02:02 PM
Yes, sir! Si, señor! Sim senhor!
Do you want to get this effect:
Name phone city prov./state
Joaquim 2820337 Madrid
Manoel 2817132 Lisboa
José 2923345 S. Paulo S. Paulo
or do you want to get something like this:
Name caller id. Name caller id.
Alex 2938577 João 2846252
Braulio 9832111 José 2820337
.. .. .. .......
.. .. .. .......
.. .. .. .......
in the first case just put "tab" btween the columns...
but in the second, to preserve the order when the dialog is maximized, do you need something more...
Cesario, from the Santa Catarina Island...
Cesario Simões, Jr.
Braulio
April 29th, 1999, 01:22 AM
Hola !
Here again with two questions more :-(...
The first effect that you told me is the effect that I want ( Name Phone city Prov./state), but I have one question..., How can I get the length of the longest string in every column ( to avoid that one string could be written over other or...).
The other way that ou told me ( Namer caller id. Name caller id.), looks very interesting ( is a good way to use the list box ( when is some more space the user can view more elements), can you tell me a little ( the idea), about how to do it in the second view ?
Thanks, muchas gracias, obrigado !
Braulio
Braulio, born in Málaga, working in Switzerland, living in Germany ( Frontier city)
Cesario Simões
April 29th, 1999, 07:26 AM
Hola, Braulio!
Do you want to get the length of string? It`s simple:
nLength=strYourString.GetLength();
You need to test each string before call AddString
The other solution i have implemented but I don`t remember exactly how I did it... If you really want to know more about, mail me and I search for this code.
You are welcome! Por nada!
Cesario, born in Santos (SP) and living in Florianopolis (SC)
Cesario Simões, Jr.
Braulio
April 29th, 1999, 08:48 AM
Obrigado !
Thanks for your help, I will try, it looks very interesting, I thought that was the thing of the lenght was in pixel or something special so I only have to take the lenght of the bigger string for each one and put it..., good !, Muy bueno si Señor !.
The other thing is good too, if you have it easy to find can you send me this ? ( my e-mail is braulio.diez@star-ag.ch).
Thanks again !, Bye
Braulio
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.