multiLine listbox

Hello all

I program win32 api in C and I need a multiline listbox, could anyone please 
tell me how I can accomplish that or refer me to some sample application.

Thank you in advance 


0
hero_2030 (2)
8/16/2005 9:29:48 PM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
166 Views

Similar Articles

[PageSpeed] 27

So far as I know all list boxes can hold multiple lines :o)  If you mean 
multiple lines per item then you may need something like:

http://www.codeguru.com/Cpp/controls/controls/lists,treesandcombos/article.php/c2291/

Or you could use a list control like:

http://www.codeguru.com/Cpp/controls/listview/article.php/c1001/

Tom


"Frank" <hero_2030@hotmail.com> wrote in message 
news:sP6dnVMmGoZRx5_eRVn-1Q@rogers.com...
> Hello all
>
> I program win32 api in C and I need a multiline listbox, could anyone 
> please tell me how I can accomplish that or refer me to some sample 
> application.
>
> Thank you in advance
> 


0
tserface (3861)
8/16/2005 9:43:40 PM
Thank you for your help but the sample is in MFC and I work with API in C 
not C++


"Tom Serface" <tserface@msn.com> wrote in message 
news:OTaYSuqoFHA.1468@TK2MSFTNGP12.phx.gbl...
> So far as I know all list boxes can hold multiple lines :o)  If you mean 
> multiple lines per item then you may need something like:
>
> http://www.codeguru.com/Cpp/controls/controls/lists,treesandcombos/article.php/c2291/
>
> Or you could use a list control like:
>
> http://www.codeguru.com/Cpp/controls/listview/article.php/c1001/
>
> Tom
>
>
> "Frank" <hero_2030@hotmail.com> wrote in message 
> news:sP6dnVMmGoZRx5_eRVn-1Q@rogers.com...
>> Hello all
>>
>> I program win32 api in C and I need a multiline listbox, could anyone 
>> please tell me how I can accomplish that or refer me to some sample 
>> application.
>>
>> Thank you in advance
>>
>
> 


0
hero_2030 (2)
8/16/2005 10:37:24 PM
"Frank" <hero_2030@hotmail.com> wrote in message 
news:J8mdnf3aW8Q695_eRVn-vA@rogers.com...
> Thank you for your help but the sample is in MFC and I work with API in C 
> not C++
>

Oops, wrong newsgroup then!  ;)

-- David


0
dc2983 (3206)
8/16/2005 10:45:55 PM
Yeah!

Tom

"David Ching" <dc@remove-this.dcsoft.com> wrote in message 
news:11g4r59c6apfs1c@news.supernews.com...
>
> "Frank" <hero_2030@hotmail.com> wrote in message 
> news:J8mdnf3aW8Q695_eRVn-vA@rogers.com...
>> Thank you for your help but the sample is in MFC and I work with API in C 
>> not C++
>>
>
> Oops, wrong newsgroup then!  ;)
>
> -- David
>
> 


0
tserface (3861)
8/17/2005 12:23:04 AM
I think you're going to have to come up with your own owner drawn version. 
You may want to consider using MFC or ATL since there are so many code 
snippets already available for UI programming.

Tom

"Frank" <hero_2030@hotmail.com> wrote in message 
news:J8mdnf3aW8Q695_eRVn-vA@rogers.com...
> Thank you for your help but the sample is in MFC and I work with API in C 
> not C++
>
>
> "Tom Serface" <tserface@msn.com> wrote in message 
> news:OTaYSuqoFHA.1468@TK2MSFTNGP12.phx.gbl...
>> So far as I know all list boxes can hold multiple lines :o)  If you mean 
>> multiple lines per item then you may need something like:
>>
>> http://www.codeguru.com/Cpp/controls/controls/lists,treesandcombos/article.php/c2291/
>>
>> Or you could use a list control like:
>>
>> http://www.codeguru.com/Cpp/controls/listview/article.php/c1001/
>>
>> Tom
>>


0
tserface (3861)
8/17/2005 12:23:56 AM
Reply:

Similar Artilces:

multiline treectrl
Hello, How can I create multiline item of treectrl? Thanks MT Multiline tree ctrls can be done using custom drawing and CTreeCtrl, but are problematic if you allow the user to edit labels, and sometime scrolling is an issue. This might be a good alternative http://www.codeproject.com/treectrl/StaticTreeControl.asp AliR. "mt" <marto@vp.pl> wrote in message news:dqp3t6$ef0$1@nemesis.news.tpi.pl... > Hello, > How can I create multiline item of treectrl? > Thanks > MT Do you mean multiple selections: http://www.codeproject.com/treectrl/MultiSelect_DragImage.asp ...

Listbox Select/DeSelect
I have a Listbox. When you click on it, it fills a textbox with the contents of column(0). What I would like to do is if you select a new record in the listbox it fills in the textbox, however if you select the record that is currently highlighted it deselects that record and inputs a 0 value into the textbox. This is what I have and it is woefully not working. Private Sub ListTerminal_Click() Dim i As Integer i = Me.ListTerminal.Column(0) If i <> Me.TxtStation Then Me.ListTerminal.Selected(i) = True Me.TxtStation = Me.ListTerminal.Column(0) ...

populate table using multiselect listbox
Access 2003 I have a main form called f001ProjectReview (PK ProjectID). There is a subform called f022Shipping(PK ShipID, SK ProjectID) with a simple multiselect listbox called lstIncoTerm. The listbox can have a multiple choice selection. When the user selects one or more items in the listbox, how do I get the table called t12ShipIncoTerms to update with the ShipID and lstIncoTerms for each selection in the listbox? Thanks in advance! -- deb On Fri, 26 Feb 2010 12:00:01 -0800, deb <deb@discussions.microsoft.com> wrote: >When the user selects one or more...

Edit box
Hi All, I want to create a simple program which has to write in an editbox numbers from 1 to 10, each on a different line. I created an integer member variable and I use a for loop to generate the numbers, but I don't know how to display them on different lines in the editbox. Any help appreciated Regards, Nicolae Just insert "\r\n". -- Jonathan Wood SoftCircuits http://www.softcircuits.com Available for consulting: http://www.softcircuits.com/jwood/resume.htm "Nicolae Fieraru" <nospam@please.com> wrote in message news:41ec500a$1@duster.adelaide.on.ne...

ListBox: formatting an item string
Hello group, I've got a problem with list box entries. The entries are composed from two float numbers. I tried to arrange the numbers into a char[255] using sprintf - which works fine for console - but the ListBox removes all the leading spaces and those between the numbers (which is more crucial) and in effect the entries do not look too good any more. Question: Is there a way to format ListBox entries like one is used from the old days console programming - or any other "new" method for achieving the same effect in nowadays programming;-)? With best regards Gerd P.S.: If y...

Sort contents of listbox
I have a listbox with several columns. Each column has a label heading. I'd like to be able to sort the listbox by clicking on a heading. I have coded this and it works. The problem is it is VERY slow because I rebuild the rowsource string and then do a requery and the query is very complex and slow. Is there any way to sort just the listbox contents without doing a requery??? No, you can't sort a list box any other way but with the row source. However, when you change the row source, a requery is not necessary. It will just run the same query again. -- Dave Hargis, Microsof...

Multiline tooltips
I'm handling TTN_NEEDTEXTx messages in my CMainFrame class and copying a string to the szText member of the TOOLTIPTEXTx structure depending on the resource id of the control. I'm doing this because the state for each control id can change and I want the tooltip to reflect the current state of the control. Okay, that all works fine, but how do I implement a multi-line height tooltip? I've tried using \r\n and just \n but the tooltips still are single line with a little box character in place of the carriage return or line feed. Anyone know how to do multi-line tooltips and if s...

Listbox Rowsource 08-02-07
I want to use a table as a listbox rowsource. But here is the catch. I want to add the record "ALL" to the listbox without adding "ALL" as a record in the table. Thanks DS DS <bootybox@optonline.net> wrote in news:DSqsi.43$ck6.18@newsfe12.lga: > I want to use a table as a listbox rowsource. > But here is the catch. I want to add the record "ALL" to the > listbox without adding "ALL" as a record in the table. > > Thanks > DS > Create a union query. SELECT "<< ALL >>" AS field1 from mytable UNION ...

dropdown listbox
vb .net 2005 aspx I have a dropbox that is binded to a table i.e. ...... item = "New York " and Item value = "NY" in the If not ispostback I read an SQL table and use the State Item value to lookup the index in the dropbox and set the selectedindex . I tested this by making a list instead of binding to a table and it works. DDState.SelectedIndex = DDState.Items.IndexOf(DDState.Items.FindByValue(IsRecordReader("State"))) The only thing I can think of is that i perform the lookup and then the binding to the table occurs which makes my lo...

Bring all data from a cell to a listbox inside a form
Dear all, I have a cell with data separeted by a ";" caracter, for example: Item1;Item2;Item3;Item4 So when I initialize my userform I would like that my listbox "lstTest" load the data in the cell (1,1) But I need the data in lines (the separation is the ";" caracter). For example: lstTest (looks like) Item1 Item2 Item3 Item4 Thank in advance!!!!!! Andr=E9. If you're using xl2k or later: Option Explicit Private Sub UserForm_Initialize() Dim myArr As Variant myArr = Split(Worksheets("sheet1").Range("a1").Value, "...

CEdit multiline
I read the contents of a file and store them in a CStringArray with each element of the CStringArray containing one line of text. then I use the following routine to display the file contents into a multiline CEdit control, however it display only one line of text Any suggestions will be appreciated. int nLines = m_strFileDataArray.GetUpperBound();; CString temp, temp1; temp.Empty(); for (int i = 0; i != nLines; i++) { temp += m_strFileDataArray[i]; temp = "\r\n"; } m_EditWnd.SetWindowText(temp); /r/n should give a line break. You need to make sure that your control ...

Userforms
I use listboxes in userforms with multiple columns for displaying rows of information pulled from the spreadsheet. Is there a way to add vertical (and horizontal) gridlines to separate the different columns (rows) of data. The listbox just displays the information hanging in free space with no dividers between columns of data. Can anyone help? It seems really strange that a gridlines option doesnt seem to be available? Thanks in advance, Roger Not that I know of. You can resized the window of the control so that only one line shows and you can space the columns with...

Averaging multiple ranges through multiselect listbox
I have a spreadsheet with a variable number of data columns. The nam of the column imported into the spreadsheet is located at the top o the column data. A list box was then created that imported the colum title as the name in the list box. How do I associate the colum titles in a multiselect list box with the data in their columns? Title 1 Title 2 Title 3 AVG 2 3 2 5 4 3 I want to be able to have a list box containing title 1, 2 and 3. then want to be able to select multiple ranges by multiselecting Title in the listbox such as Title 1 and ...

Using code to move to the top record of a listbox
I want code that will cause the listbox to move to the top record and behave as if I clicked the top record. Thanks Avid, lstYourListBoxName = lstYourListBoxName.ItemData(0) -- hth Al Campagna Microsoft Access MVP 2007-2009 http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Avid Fan" <me@privacy.net> wrote in message news:O9283KnyKHA.1236@TK2MSFTNGP06.phx.gbl... > > I want code that will cause the listbox to move to the top record and ...

paste multiline text to a single cell-Excel 97
I wrote a little macro to do this with the .GetFromClipboard method and it works fine, but many users will need to do this in the org and I'm wondering if there's a simpler method. Based on other recommendations I tried the replace Alt+0010 method and got an error message that the 'Formula is too long.' Is there a simpler method? Thanks! Cindy Maybe they could just paste into the formula bar. But I don't think I understand the real question. cgbikes wrote: > > I wrote a little macro to do this with the .GetFromClipboard method and it > works fine, but man...

Listbox execute SQL error
Hi groupies My form has 2 list boxes. The left box lists items in a truck the right box lists items on a rig site. My code for moving from the truck to the rig is fine but it is not working properly when moving items from the rig to the truck. I use the following code to move items from the rig to the truck: Private Sub cmdRemoveOneSite_Click() Dim strSql As String Dim strWhere As String Dim varItem As Variant Dim rst As DAO.Recordset Dim db As DAO.Database 10 Set db = CurrentDb() 20 If Me.lstOnSite.ItemsSelected.Count = 0 Then 30 ...

How to bring data from a listbox to a cell?
Dear all, I have a listbox in a form, and I need to bring the selected itens in a cell... How can I do it? For example: lstTest Item 1 (Selected) Item 2 (Not Selected) Item 3 (Selected) So when I click in a button in this form, the cell (1,1) needs to have the data: Item 1, Item3 I input this code in the button, but it brings only the first item in the lstTest... Cells(1, 1).Value =3D lstTest.List Thanks in advance!!! Andr=E9. Andre, Could you send the whole code for the button? "gatarossi@ig.com.br" wrote: > Dear all, > > I have a listbox in a form, and I need...

Owner Draw Listbox
I've derived from CListbox, set all the construction parameters using the resource editor etc etc char m_cOut[2048]; void CGridtempDlg::OnButton1() { char cOut[2048]; strcpy(cOut, ("Rate|Start Date|End Date"); strcpy(m_cOut, "18.8|13/09/04|18/12/22"); m_lst.AddString(cOut); //fails (or garbage) m_lst.AddString(m_cOut); //OK m_lst.AddString("19.9|19/12/04|"); //OK } Do I need to override a CListBox function? This all works if my control is a CListBox (but I have to switch off the ownerdraw property to make it compile...) Many thanks... ...

multiline appointments
I synchronize my outlook calendar with my Palm device. On the Palm I can easily create appointments with multiple lines which show up correctly in various views. These appointments show up with multiple lines after synching to Outlook if I double click on an appointment to bring up the appointment form. But the form shows a maximum of 2 lines at a time. The only way to create a line break in Outlook seems to be to copy the line break from an appointment I created on the Palm and paste it into the Outlook appointment form. However, when trying to print a list of appointments, I can eith...

Records in Listbox Identified in Reverse Order
Hello, I have a list box that is populated as data is entered into the form. (I'm reusing a database that worked well, but needed editing for a different project.) In the original database, the records were identified correctly--first item entered is record 1, second item entered is record 2,... In the "new" database (I had to modify some data sources), the items are in reverse. The first item entered is record 2, the second item entered is record 1,... Any idea why this is occurring? I've checked what I know to check and cannot tell what the problem ...

Listbox ?
Is it possible to prevent a user from selecting any item in a listbox? I'm using a listbox to display the values of several cells. I just want the user to be able to scroll through the list box and read what is there but not select anything. is this possible? Thanks for the help. -- JT You can set the enabled property to False, if the list box is from the control toolbox. However, if the user is Excel xavvy, they can change it back to true. Maybe a textbox or a label would have been a better choice. "JT" <JT@discussions.microsoft.com> wrote in ...

multiline Static
I have derived a class from CStatic to set the background and foreground colour. I want to make the text multiline. I have tried \n \n\r and variants of in SetWindowText. Is it even possible? Can anyone help? -- Malcolm Clarke "Malcolm Clarke" <not4bad@hotmail.com> wrote in message news:%23ovMI4oSFHA.1152@tk2msftngp13.phx.gbl... > > I have derived a class from CStatic to set the background and foreground > colour. I want to make the text multiline. I have tried \n \n\r and variants > of in SetWindowText. > > Is it even possible? Can anyone help? > &...

listbox row height
I would like to add code to the MouseDown event of a listbox so that it will take different action depending on whether the column headers are clicked or the body of the list is clicked. For this I need to know the row height. How can I determine the row height? -- - Paula ...

multiLine listbox
Hello all I program win32 api in C and I need a multiline listbox, could anyone please tell me how I can accomplish that or refer me to some sample application. Thank you in advance So far as I know all list boxes can hold multiple lines :o) If you mean multiple lines per item then you may need something like: http://www.codeguru.com/Cpp/controls/controls/lists,treesandcombos/article.php/c2291/ Or you could use a list control like: http://www.codeguru.com/Cpp/controls/listview/article.php/c1001/ Tom "Frank" <hero_2030@hotmail.com> wrote in message news:sP6dnVMmG...

Listbox returning numeric value not string
I have a multiselect listbox that lists all users in my MDW file. After making selections and submitting my form, the values that were selected are not the text strings displayed in the lisbox, but rather numeric values. How do I return the text string? If you have multiple columns in your list box, you can return the correct value by identifying the column you want. If the text is in say column 2, you would use Me.MyListBox(1) Column numbers for a list box start at 0. -- Dave Hargis, Microsoft Access MVP "Scott Whetsell, A.S. - WVSP" wrote: > I have a multiselect l...