CListCtrl multiline cells

I have CListCtrl type report.
I need to write into it's items multiline text.
When I insert into text "\r\n", it does not help.

How to write multiline text into CListCtrl cell ?

Other thing what I need is to change font in some cells.
I know SetFont(), but how can I retrieve HWND of cell ?

Thanks !
Peter
0
Peter2031 (451)
9/1/2005 11:55:02 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
819 Views

Similar Articles

[PageSpeed] 55

You have to create an owner draw control that does that.
The only problem with that is that all your rows have to have the same
height which could cause problems

Here is an example of how to do it: (not so good but at least is a starting
point)
http://www.codeproject.com/listctrl/changerowheight.asp

AliR.

"Peter" <Peter@discussions.microsoft.com> wrote in message
news:5ADCF914-BF89-43F8-9C60-9B8AA10F31D3@microsoft.com...
> I have CListCtrl type report.
> I need to write into it's items multiline text.
> When I insert into text "\r\n", it does not help.
>
> How to write multiline text into CListCtrl cell ?
>
> Other thing what I need is to change font in some cells.
> I know SetFont(), but how can I retrieve HWND of cell ?
>
> Thanks !
> Peter


0
AliR3470 (3234)
9/1/2005 2:37:22 PM
Looking at this source code might help you out.

http://www.codeproject.com/miscctrl/ReportProject.asp

Tom

"Peter" <Peter@discussions.microsoft.com> wrote in message 
news:5ADCF914-BF89-43F8-9C60-9B8AA10F31D3@microsoft.com...
>I have CListCtrl type report.
> I need to write into it's items multiline text.
> When I insert into text "\r\n", it does not help.
>
> How to write multiline text into CListCtrl cell ?
>
> Other thing what I need is to change font in some cells.
> I know SetFont(), but how can I retrieve HWND of cell ?
>
> Thanks !
> Peter 


0
tserface (3861)
9/1/2005 2:56:56 PM
Reply:

Similar Artilces:

FOrmat cell
HI, I want to format excel cells in my workbook in away where if i enter negative figures, cell colour or font colour becomes RED and for all possitive figures it is green. Can i kindly get some advice. Thanks, -- kaushi Kaushi Format the area you are making your entries the green font color you like. Then goto Format>cells>Number and select the red (1234.10) select the number of decimal places you want and the thousands separator (,) if you want that. This will put all negative numbers in red with (...). If you don't want the parans you can now click on the custom cat...

delete rows when any cells in column A is filled in RED color
Hi people, I need your help for a VB code that can delete the rows with any cells in column A being filled in RED color ? Alternatively, it will be fine for me if you have the code that can move the rows to the top when there are cells being filled in RED color in column A . Thanks in advance for help. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements If the colors are ...

Conditional formatting / blank cells
Hello, I need help with a Conditional Format. This is my worksheet. Row 4 A B C D E F G H I $200 $210 I want a conditional format in G4 that states if G4 is greater than or equal to F4 the fill colour is green. If G4 is less than F4, the fill colour is red. If G4 is blank, the fill colour is white. I've tried numerous combinations, but cannot seem to get this to work. Thanks torkattack. Test for the blank first. -- David Biddulph "torkattack" <torkattack@discussions.microsoft.com> wrote ...

CListCtrl Header height change??
CListCtrl Header height change?? Is it possible to change the height of a CListCtrl Header.? Thanks Markus ...

Change Cell Background Colour
Some cells in my worksheet are fed from a dropdown (validation) menu. I would like the background colour of individual cells to change automatically depending on which item is selected from the menu. Is this possible with conditional formatting or VBA? I'm very familiar with VBA in Access but haven't yet ventured into the world of Excel/VBA. Could someone point me in the right direction please? TIA Terry WinXP/OXP (design) O2K (runtime) You can set up to four colors (normal background + 3 others) using Conditional Formatting. See XL Help. For more than three colors, check the arc...

CopyFromRecordset only pastes 1823 characters in a cell!?
Range(FirstDataRange & "3").CopyFromRecordset rstData That's it. This is my problem line. The last field in the recordset is a MEMO field stored in an Access db. The field contains about 50-odd thousand characters. Whent the above line executes, the cell containing the last field of the recordset only contains 1823 of the last field's value. range("fc10")=rstdata.Fields(158).Value This line actually works differently. It copies 32,767 (the cell's limitation) of the last field's value, which is what I was expecting from the CopyFromRecordset fu...

Problems with CListCtrl
I'm having trouble with a CListCtrl object. I'm trying to automatically set the selected items of the list from my code. I try the following statement: m_List.SetItem (pos, 0, LVIF_STATE, NULL, 0, LVIS_SELECTED, LVIS_SELECTED, 0); The SetItem function returns non-zero, which supposedly means it was successful. However, I don't see any selection showing up. I even called RedrawItem on this list item, but it didn't help either. Anyone know about this? -Eric >I'm having trouble with a CListCtrl object. I'm trying to automatically >set the selected ite...

CTreeCtrl and CListCtrl problem
I use create a single document struct using MFC(explore style).The left of the window is CLeftView class(which inherit CTreeView).The right is CBrowserView which inherit CListView.I want to display the content of a directory in the right(CListview) when user click the item of the ctreectrl. In the LeftViw I add method "void CLeftView::OnClickItem (NMHDR* pNMHDR, LRESULT* pResult)" because I want to know which item be clicked by user. ////////////////Leftview////////////////////// CTreeCtrl& mtree=GetTreeCtrl(); HTREEITEM item=mtree.GetSelectedItem(); data=mtree.GetItemDat...

CListCtrl and sub item editting
Hi, Is it possible to implement CListCtrl sub item editting without creating a custom ctrl? I am using VS2003. TIA Tony >Is it possible to implement CListCtrl sub item editting without creating a >custom ctrl? Tony , There's no built-in support for this, so no, you have to provide some implementation for this. Have a look on sites such as CodeGuru and CodeProject, they'll have examples. Dave Thanks Dave, I've seen examples, I just wasnt sure if I needed my own ctrl. Regards Tony "David Lowndes" <DavidL@example.invalid> wrote in message news:k...

Custom Cell Format #2
Good Morning: I would appreciate any help with the following problem: I am using XP OS and Excel 2002. I need to enter a series of numbers (which are really text since no calculation will be needed). For instance I might need to add the following: 4000-5002-4911-1567 I created a custom format cell of 0000"-"0000"-"0000"-"0000 When I enter 4000500249111567 it displays 4000-5002-4911-1560 . The custom format appears to be rounding all my last digits to zero. Thanks in advance, for any help. That is because you are coming up against Excel precision limits, 15 ...

Cell D3 = Cell A1 for the Value as well as formats
If in Cell D3 we fill with "=A1" then Value of D3 always equal to that of A1. If A1 contains Bold or Italic Texts , how can D3 contains the same? Thanks, SUNAN. After filling D3 with "=A1", click on A1: Edit > Copy click on D3 and then: Edit > Paste Special and check format. -- Gary''s Student "Sunantoro" wrote: > If in Cell D3 we fill with "=A1" then Value of D3 always equal to that of A1. > If A1 contains Bold or Italic Texts , how can D3 contains the same? > Thanks, SUNAN. ...

How to find a cell with a particular date format?
Hi, For example, I have a cell that shows the date as 08/11/07. How can I use the Find command to locate it? TIA Tom Select that cell (just for testing). Look at the formulabar--not what's displayed in the cell. Use that when you try your Find. Tom wrote: > > Hi, > > For example, I have a cell that shows the date as 08/11/07. How can I use > the Find command to locate it? > > TIA > Tom -- Dave Peterson Ctrl-F, click on the Options>> button, then the Format... button. Leave search field empty to find all cells with ...

Copying data without blank cells, and only certain cells
I have 3 questions: 1). I receive large data sets from scientists in excel format that' been transferred from some instrument. In column A are numbers usuall starting from 200 to 780 counting up every one unit. In the column is the data corresponding to the numbers in column A. I'm trying t figure out a formula that will copy the number 200 and every 5 unit thereafter (200, 205, 210...etc) in one column plus the data tha corresponds to that number in other column. 2). Also, in some data sets I receive, there are an even amount o blank cells between each filled cell. So A1 w...

Linking Option Buttons to Cells
Hi, I am develping qa questionnaire with something like 120 rows in it. Each row has 7 possible responses in it. Each response has an options button/check box associated with it (In don't mind which), but only 1 button can be selected from each row. The questionnaire therfore has something like 840n option buttons in it. So far, so good. What I want to do is link each button to a unique cell reference, but given the number of cells, I don't want to have to go into the properties dialogue of each one and change it manually. Is there any way of replicating the buttons such tha...

cell reference
hi, i have formula in cell A5 and when i double click, it takes me to the respective cell. my question how can i go back to that cell (A5) Hit the F5 key / enter A5 / hit OK. If my comments have helped please hit Yes. Thanks. "Rohit" wrote: > hi, > i have formula in cell A5 and when i double click, it takes me to the > respective cell. my question how can i go back to that cell (A5) As ALWAYS, post your code for comments. Private Sub Worksheet_BeforeDoubleClick _ (ByVal Target As Range, Cancel As Boolean) If Target.Address <> Range("g...

How to add clistctrl into clistctrl?
How to clistctrl into a clistctrl? For example like adding checkbox , combobox, i want to add clistctrl into a clistctrl ...

CELL FORMATING #4
I just downloaded the 2005 calendar w/notes and find that there are cells gouped together as on large cell (month). How do you do this? One possibility of what you describe. select several cells. Then do Format=>Cells, go to the alignment Tab and click the merge cells checkbox. -- Regards, Tom Ogilvy "thom kamp" <thom kamp@discussions.microsoft.com> wrote in message news:0E73BC30-09E5-4428-9525-E19C6EF71A9F@microsoft.com... > I just downloaded the 2005 calendar w/notes and find that there are cells > gouped together as on large cell (month). How do you do this...

How to get a cell to error if the wrong figue is entered
I have a worksheet that is a quote form for quoting on bricks. Bricks are only avaliable in lots of 66. So if my sales people are giving a quote say for 3000 bricks this would not be possiable because they only come in lots of 66, the figue they would have to enter would be 3036. I was wondering if there is a way to get the cell to show an error if the figue entered dose not work with multiables of 66. Thanks Why not just have them enter the number of lots instead? Then have your formula multiply it by 66. ************ Anne Troy www.OfficeArticles.com "Eintsein_mc2" <simonmerk...

User form pop up if cell is empty on close workbook
I have created a user form in a workbook. I would like the form to pop up if a certain cell in a worksheet is empty when the user tries to close the workbook. I dont know how to write the code in VBA. Can anyone help with that? I am using XL2002 and WinXP Pro. TIA for any help Dave Bob, I've taken your code and put in the sheet and range values that I need to. In VBA, I inserted a module in the workbook and copied and pasted the code into the module and saved file. However, It doesn't seem to be working. I can close the workbook without being prompted by the userform1. I did notice t...

how to highlight a cell so I know which point on the chart it is?
Hi, I am curious to see if anybody could create a visual relationship between a point on the chart and the data cell. Let's say if we have 1000 points on the chart, when I point to one of them--it will show the values--but I still have no idea where the point actually comes from. Or on the other hand, when I try to hightlight some cells using formats, the best thing is to see the points on the chart also being highlighted in some way. Thanks for any hints there. Windson: I am not sure whether I can help you here. If you select a data point and you move it Excel pops up a Goal Seek...

Semi-lock Cells
The sheet doe’s get protected and cells are “properly” locked and unlocked, but there is a strange occurrence that I find difficult to replete in some of my cell groupings. I have lookup cells that reference other sheets. When I change the data in the other sheets and go back to this sheet with a locked cell the data does not change. If I do it with an unlocked cell the data changed but the user can also change the cell. Some how I have a semi-grayed locked selection in some of these lookups that allow me to change the data in the other sheet and have it change in this sheet with out al...

Indicating selected cell
I have a worksheet set up with borders around the cells and when the cell is selected, it just shows a thin double line around 3 sides of the cell selected so it is hard to tell which cell is selected. Is there a way to shade or display the selected cell in a different color? LGuest, Try this out: http://www.cpearson.com/excel/RowLiner.htm John "LGuest" <LGBeach8@yahoo.com> wrote in message news:142201c3e031$0047f140$a301280a@phx.gbl... > I have a worksheet set up with borders around the cells > and when the cell is selected, it just shows a thin double > lin...

naming cells in multiple worksheets #2
Frank, Thanks, Crai -- cparson ----------------------------------------------------------------------- cparsons's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1286 View this thread: http://www.excelforum.com/showthread.php?threadid=26681 ...

CListCtrl::InsertItem strange behaviour?
Hi everyone, I have a dialog with a couple of ListCtrl on it. I'm filling them up with information when the dialog initializes. Therefore i have two loops, one for each ListCtrl, on both loops I use the same function to insert the items: myListCtrl1.InsertItem(0, anyString); --- myListCtrl2.InsertItem(0, anyString); The weird thing is : the first loop InsertItem is always inserting the Item on the first position (InsertItem returns a 0 always); displacing the previous inserted item. BUT, the second loop InsertItem is always inserting the item on the last position (InsertItem retu...

Problem entering the number 52 in a cell
When I enter 52 in a cell this is what it changes to automatically: 1*50*44* 2*42*50* 3*48*41* 4*50*48* 5*47*49* 6*52*47* Does anyone know why? Take a look under tools|autocorrect options|autocorrect tab. Look for 52 in the left hand column. gall wrote: > > When I enter 52 in a cell this is what it changes to automatically: > 1*50*44* 2*42*50* 3*48*41* 4*50*48* > 5*47*49* 6*52*47* > > Does anyone know why? -- Dave Peterson ec35720@netscape.com Dave, Thank you so much. That w...