CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    May 1999
    Location
    Spain
    Posts
    335

    Is easy to use the multi column style with list boxes ?

    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


  2. #2
    Join Date
    Apr 1999
    Location
    Campeche - Florianopolis - Sta. Catarina Island - Sta. Catarina State - Brazil, South
    Posts
    104

    Re: Is easy to use the multi column style with list boxes ?

    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.

  3. #3
    Join Date
    May 1999
    Location
    Spain
    Posts
    335

    So every "Tab" character separates one column ?

    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



  4. #4
    Join Date
    Apr 1999
    Location
    Campeche - Florianopolis - Sta. Catarina Island - Sta. Catarina State - Brazil, South
    Posts
    104

    Re: So every "Tab" character separates one column ?

    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.

  5. #5
    Join Date
    May 1999
    Location
    Spain
    Posts
    335

    Hola !

    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)


  6. #6
    Join Date
    Apr 1999
    Location
    Campeche - Florianopolis - Sta. Catarina Island - Sta. Catarina State - Brazil, South
    Posts
    104

    Re: Hola !

    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.

  7. #7
    Join Date
    May 1999
    Location
    Spain
    Posts
    335

    Obrigado !

    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 [email protected]).

    Thanks again !, Bye
    Braulio


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured