Click here to Skip to main content
Click here to Skip to main content

Multi-line List Control

By , 5 Sep 2006
 

MultilineListControl1.gif

Introduction

This article provides a custom control which displays a multi-column list of items, with support for multi-line text in individual cells. Cell text can contain embedded '\n' characters which will force line breaks. In addition, word-wrap is performed as needed to keep the text within the specified column width.

The utility of this is that it allows you to display a list of items which can contain multi-line text. You and/or the user sets the column widths, and the control dynamically picks the row heights to support the cell text. The standard list control does not support multi-line text (or varying row heights which are needed to support multi-line text).

The demo project linked above provides the source, and an executable for an app which populates the control as shown in the image above. The demo app also handles notification of selection changes by updating the title bar to indicate which item has been selected.

The code was compiled with Visual Studio .NET 2003 with SP1 applied (Visual C++ v7.1).

Background

The need to display information in a tabular format is usually satisfied by using the standard list control in report mode. A limitation of this solution is the lack of support for multi-line text in the cells.

This custom control was created with the goal of addressing this limitation. The idea was to allow the control user to set the column widths and have the control dynamically adjust the individual row heights as needed to fit the text within those widths. The control should word-wrap the text as needed, and should honor any embedded '\n' characters by forcing line breaks.

In designing and coding this control, the focus was solely on removing the above limitation, as opposed to creating the ultimate grid control (see the References section for some complete grid control articles). As a result, this control does not do everything the standard list control does, and does far less than many higher-end grid controls. The idea was to provide textual multi-column data in a tabular format such that multi-line text would just work as expected. The limited scope was aimed at providing a very simple, easy to use solution to this particular limitation of the standard list control.

Having said that, this control is not derived from the standard list control since it didn't seem feasible to modify the existing control to remove the single-line limitation. Therefore, the interface isn't a drop-in replacement for the standard list control. See the remainder of the article for details on how to use the control.

Using the code

Adding the control to your project

To use the control in your code, add the CMultilineList.h and CMultilineList.cpp files to your project.

Creating the control

For some background on creating and using custom controls, you may wish to read Chris Maunder's Creating Custom Controls[^] article.

If you're using the Visual Studio dialog editor, you can create a custom control and set the Class string in the properties editor to CMultilineList. You can then right-click on the custom control and select "Add Variable", and add a control variable of type CMultilineList.

If you'd instead like to dynamically create the control yourself, just create an instance of the CMultilineList class and then call the Create method.

Populating the list

The first thing you'll want to do is set the overall size of the list (# columns and # rows). Once you've done this, you can setup the column widths, specify text for the column headings, and then fill in the cells with text. The public methods used to perform these tasks (and a few others) are shown below.

The row and column indices are zero-based, and there is no item/sub-item distinction as with the standard list control (since only a report/grid-style view is supplied).

/**
* Sets the overall geometry of the grid. When reducing the size using this
* method, anything which is then outside the new size is deleted. You must call
* this before anything else to ensure the size you need is available.
* @param nCols Desired number of columns (which are numbered [0...N-1])
* @param nRows Desired number of rows (which are numbered [0...N-1])
*/
void SetSize(int nCols, int nRows);

/**
* Gets the current overall geometry of the grid.
* @param nCols will be initialized with the number
*        of columns (which are numbered [0...N-1])
* @param nRows will be initialized with 
*        the number of rows (which are numbered [0...N-1])
*/
void GetSize(int & nCols, int & nRows);

/**
* Sets the text shown in the heading above the specified column.
* @param col the column number [0...N-1]
* @param heading the text to be displayed
*/
void SetColHeading(int col, LPCTSTR heading);

/**
* Sets the width of the specified column in pixels. Note that the user cal
* also change this themselves by dragging the column separators in the
* header control.
* @param col the column number [0...N-1]
* @param width desired width of the column in pixels
*/
void SetColWidth(int col, int width);

/**
* Sets the text for the specified cell. The text may contain '\n' which
* will cause line breaks and heightening of the row as needed. The text
* will also be word-wrapped to ensure it fits within the column width.
* @param col the column number [0...N-1]
* @param row the row number [0...N-1]
* @param text the desired text for the cell
*/
void SetCellText(int col, int row, LPCTSTR text);

/**
* Gets the current text in the specified cell.
* @param col the column number [0...N-1]
* @param row the row number [0...N-1]
* @return text in the specified cell
*/
CString GetCellText(int col, int row);

/**
* changes the current selection to the specified row. changing the selection
* programmatically using this method will not trigger a WM_COMMAND notification
* message to be sent to the parent window.
* @param row the row number to select [0...N-1]
*/
void SetSelRow(int row);

/**
* Gets the row number [0...N-1] of the currently selected row.
* @return the currently selected row number
* [0...N-1] or -1 if no row is currently selected
*/
int GetSelRow();

/**
* Gets the row which is displayed at the specified client co-ords in the window
* @param pt the point in client coords
* @return the row number [0...N-1] which the specified
* point is over (or -1 if there is no row at that point)
*/
int GetRowFromPoint(CPoint pt);

/**
* Ensure the specified row is visible
* @param row the row number [0...N-1]
*/
void EnsureRowIsVisible(int row);

A brief example which illustrates using some of the above methods is shown below. In the example below, m_items is a variable of type CMultilineList.

// create a list with 3 columns and 5 rows
m_items.SetSize(3,5);

// first two columns 100 pixels wide and the third column 200 pixels wide
m_items.SetColWidth(0,100);
m_items.SetColWidth(1,100);
m_items.SetColWidth(2,200);

// set the column heading text
m_items.SetColHeading(0,_T("Name"));
m_items.SetColHeading(1,_T("Quantity"));
m_items.SetColHeading(2,_T("Description"));

// populate the list data
m_items.SetCellText(0,0,_T("Coffee Beans"));
m_items.SetCellText(1,0,_T("12"));
m_items.SetCellText(2,0,
   _T("An essential part of the daily diet for ensuring " ) 
   _T("productivity is at required levels.\n\nNOTE: Decaf is for wimps!"));
m_items.SetCellText(0,2,_T("Water"));
m_items.SetCellText(1,2,_T("10"));
m_items.SetCellText(2,2,_T("Listed as a dependency of the coffee beans module."));

The results of the above sample code are shown in the image below:

MultilineListControl2.gif

Handling notifications from the list

When the user clicks in the control to select an item, a notification is sent to the control's parent window. For the sake of simplicity, the list box LBN_SELCHANGE message is used (instead of using the list control notification message). This is sent as a WM_COMMAND message to the parent, just as with a list box. The below code excerpt is taken from the demo application, and illustrates responding to a selection change by updating the titlebar text.

BOOL CMultilineListDemoDlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
   // IDC_ITEMS is the ID assigned to the control in this dialog
   if ((HIWORD(wParam) == LBN_SELCHANGE) &&
       (LOWORD(wParam) == IDC_ITEMS))
   {
      int selRow = m_items.GetSelRow();

      if (selRow < 0)
      {
         SetWindowText(_T("MultilineListDemo"));
      }
      else
      {
         CString s;
         s.Format(_T("MultilineListDemo (you have selected %s)"), 
                  m_items.GetCellText(0,selRow));
         SetWindowText(s);
      }
   }

   return CDialog::OnCommand(wParam, lParam);
}

Points of interest

Although the goal was to add multi-line text, creating a custom control to do that brought in a bunch of other requirements. There are a number of things which are taken for granted in the standard controls which must be handled in a custom control. For example, maintaining the current font, figuring out how to scale/position everything and respond to events appropriately in an attempt to make the control look and behave like a "normal" list control, and other sneaky things which would pop up during initial testing.

One of the major impacts from supporting multi-line text was the varying row heights. When rendering the visible area of the list, it is of course necessary to compute the row heights for those rows. But it becomes necessary to know all the row heights when, for example, getting the scroll bars to work as expected and supporting item selection. The class uses a std::map which maps integer row numbers to pixel row heights. The assumption is that any height in the map is valid. Row heights are invalidated by removing them from the map. So, for example, when the text of a cell is changed, the corresponding row height is invalidated. When column widths are dragged by the user (or set programmatically), all the row heights are invalidated. The CalculateRowHeights() method is then used to calculate any row heights not already in the map. Many other sections of the code then rely on being able to have this map of row heights to do their calculations.

Finally, a disclaimer is probably necessary. I'm sure I missed a number of "standard" behaviors which might be expected from the standard controls, although hopefully I didn't manage to miss them all. There isn't complete support for styles and heavy customization etc., and the full suite of notifications isn't yet provided. So, consider this an initial/draft release.

References

License

The LGPL open source license[^] was selected for the code, since that does not restrict how you can use the code in your own projects or enforce any licensing model on your projects which use it (unlike GPL). It only asks that if you modify/improve/fix the code that those modifications/improvements/fixes are also contributed back to the community.

History

  • September 4, 2006 - initial release.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Dave Calkins
Software Developer (Senior)
United States United States
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionResizing the control according to the colums sizememberaslamshikoh14 Feb '13 - 21:02 
Great utility for multiline support in MFC.I am implementing this control and want to know ,how i can remove the whitespace which comes on the right most side when we reduce the column width.this sometimes looks awkward and shoes up a blank space.Thanks once again for this article.
QuestionCreate Function can not workmemberczyt198811 Jan '13 - 14:40 
i create this ctrl by this code:
m_plist = new CMultilineList;
m_plist->Create(this,CRect(20,200,20,200),IDC_LIST,WS_VISIBLE|WS_CHILD);
and It crashes pointing to the Assert Statement (below)
_AFXWIN_INLINE int CFont::GetLogFont(LOGFONT* pLogFont)
    { ASSERT(m_hObject != NULL);
        return ::GetObject(m_hObject, sizeof(LOGFONT), pLogFont); }
i find that the problem is in void CMultilineList::PreSubclassWindow()
GetParent()->GetFont()->GetLogFont(&lf);
GetFont()will return NULL
so how can use this ctrl by Create Fun?
QuestionAdd ColorsmemberSchehaider_Aymen1 Mar '12 - 22:42 
Hi,
 
i m wondering how could i modify the color of this custom control (i used to overload the OnCustomDraw but I am unable to do it on this control.
 

thank you
"The Ultimate Limit Is Only Your Imagination."

QuestionIts to ask you one doubt, and i too facing the same issue for my list control......memberPraveenKannoth29 Dec '11 - 21:44 
When you select the first item < widget_1> you can see a 2pixel gap between that selected item and the header control of the list control.
Its only coming when we set the extend style LVS_EX_FULLROWSELECT..
 
How we can solve that?? , you have any suggestion..
 
I tired by googling, but cant find any solution....
Questioncan not creatememberhuangyujin03 Jul '11 - 3:33 
On VC++6.0
using dynamic create control, code as follow
CMulilineList *m_p=NULL;
m_p=new CMulilineList;
m_p->create(this,rect,1235,WS_VISIBLE | WS_CHILD);
 
when run this on MFC Dialog
there is error about "xxx 0xC0000005:Access Violation"
after debug find the issue is in the "m_p->create(this,rect,1235,WS_VISIBLE | WS_CHILD)"
help help who can tell me why
Generalproblem with on the view, Please helpmemberasyncContact10 Nov '09 - 22:24 
this control create on the cview, error!!!
dialog using this control success. but cview using this control error.
 
help me Cry | :((
JokeJust a thank.memberlevietdung882 Aug '09 - 19:45 
Thanks for your article. It's very useful for me.
 
asdfasdfasdfasdfsadf
 
I'm what I belong to.

GeneralRe: Just a thank.memberlevietdung882 Aug '09 - 19:48 
do anyone agree with me.
 
Is there anyone here.

GeneralProblem using this controlmembersrinathtest11 Oct '08 - 16:53 
I have been trying to use this control but facing problems. When I use my VS 2005 dialog editor and add a custom control to my dialog, the option to add a variable is disabled on right clicking the custom control. Any idea what is going wrong?
QuestionCatch the coloum click event?membervayas_zsolt21 Aug '08 - 21:39 
How I can catch this event pls help me quickly.
QuestionSortItems in List?membertermal12 Aug '08 - 22:25 
Hello,
is it posible to sort items in list???
 
thanks
termal
QuestionControl is not working properly in modeless dialogmemberSlepchenkov31 Jul '08 - 7:53 
The control works perfect in modal dialog.
But when I tried to use it in Modeless dialog I found a strange problem:
- The header is not redraw correctly, sometimes I see only last column header
- I cannot change size of columns with mouse. The header simply doesn't receive messages from mouse (I used spy to see this).
 
Can anybody help?
GeneralLeaking memorymember[NL]PUR23 Jun '08 - 23:56 
I don't know if i'm the only one experiencing this, but when adding
items it takes 80kb per item that isn't freed. Even when the dialog closes the memory remains
in use.
Does anyone know what might be using up that memory?
GeneralAlso no gridlines, and sometimes it comes up blankmemberdiadempro30 May '08 - 18:26 
I am using the multilinelist in an MFC project under VS2008, and I also do not see gridlines. I see the gridlines when I run your sample, so I have no idea what is going on.
 
Also, sometimes when I have the list populated, and then I re-populate it with something else, it just comes up blank. From then on, no matter how many times I try to reload it with other content, it stays blank until I restart the application.
 
I wonder if it is getting in a state where PrepareOffscreenSurface just always returns FALSE. Is that possible?
GeneralA little problemmemberspiree22 Dec '07 - 8:58 
I can`t derive any new class from your CMultilineList.
 
I also couldn`t place CMultilineList in my project. It does not work.
It works only in your project, don`t know why.
 
Next. I placed the second MultilineList in your dialog and tried
to make popup menu in dialog class. When clicked Right Mouse Button
it`s OK, but when the key is pressed "Shift+F10" or "Menu" in the second
instance, the message ON_WM_CONTEXTMENU gives the handle of the first instance.
 
It`s very strange.
 
Can you help how to place correctly your class into new project?
GeneralNow way to create it by calling Create()memberpierz9 Nov '07 - 2:56 
I'm using VS2005.
 
First I ve a little bug with the GetParent()->GetFont() which return NULL @line:486(fixed).
After i've a more serious bug whent it calls CreateChildControls(); @line:496. I've an assertion in wincore.cpp @line:329 :
[...]
BOOL CWnd::Attach(HWND hWndNew)
{
ASSERT(m_hWnd == NULL); // only attach once, detach on destroy
[...]
QuestionHow to make checkbox control in ListCtrl....?membermOre-26 Oct '07 - 15:03 
How to make checkbox in ListCtrl....?
NewsCould have been derived from CListmemberAtul D. Patil20 Aug '07 - 2:37 
This control could have been derived from CListCtrl. But it has beed derived from CWnd and is a "from scratch" work!! The efforts are really appriciable. But what negative is it can not be used as "replacement" to CListCtrl. Cry | :((
 
In my project I already have used CListCtrl at few places. I wanted the control to be multiline so I just replaced CListCtrl with CMultilineList and compiler thrown errors:
 
error C2039: 'InsertColumn' : is not a member of 'CMultilineList'
see declaration of 'CMultilineList'
error C2039: 'GetItemCount' : is not a member of 'CMultilineList'
see declaration of 'CMultilineList'
error C2039: 'GetItemText' : is not a member of 'CMultilineList'
see declaration of 'CMultilineList'
error C2039: 'SetItemText' : is not a member of 'CMultilineList'
see declaration of 'CMultilineList'
error C2039: 'InsertItem' : is not a member of 'CMultilineList'
see declaration of 'CMultilineList'
error C2039: 'DeleteAllItems' : is not a member of 'CMultilineList'
see declaration of 'CMultilineList'
error C2248: 'CMultilineList::GetThisMessageMap' : cannot access protected member declared in class 'CMultilineList'
see declaration of 'CMultilineList::GetThisMessageMap'
see declaration of 'CMultilineList'
error C3861: 'HitTest': identifier not found
error C3861: 'GetFirstSelectedItemPosition': identifier not found
error C3861: 'GetNextSelectedItem': identifier not found
error C3861: 'SetItemState': identifier not found
error C3861: 'GetItemText': identifier not found

 
The reason is simple, all these methods are members of CListCtrl but are not of CMultilineList. D'Oh! | :doh:
 
There might be equivalent methods/ways to these methods in CMultilineList. But I really can not afford making changes everywhere I have called methods of CListCtrl in the whole code! OMG | :OMG:
 

 
-- modified at 2:21 Tuesday 21st August, 2007
Questiongood control!! [modified]memberleeksmcm13 Aug '07 - 21:03 
It's really good custom list control.
 

When I used this control by calling create function like this,
 
m_items2.Create(this, CRect(10, 150, 520, 300), 10001);
 

in PreSubclassWindow()
 
// create default font matching parent's font
LOGFONT lf;
GetParent()->GetFont()->GetLogFont(&lf);
 
the program died in above code section by null pointer exception.
 
let me know what the problem is.
 
Thanks.
 

-- modified at 22:11 Wednesday 15th August, 2007
AnswerRe: good control!!memberGardien4219 Sep '07 - 10:48 
I have the same problem, i solve it by adding a test on the "GetFont()" return value which is NULL. So i Create a new CFont etc...
 
but after i have another problem...
 
Someone can make it work ? :X
GeneralRe: good control!!memberGardien4219 Sep '07 - 10:58 
Ok i found the solution.
 
On the "Ressource Editor" add a Custom Control with CMultilineList in class.
Add a variable with the same class.
 
It work well for me Smile | :)
GeneralRe: good control!!memberMember #408077817 Feb '08 - 21:08 
Hello.
I have use you idea.
But it's still have the problem.
I'm using VC++6.0 SP6, Window XP.
QuestionI have a quetion..memberMinjooJang7 Jun '07 - 16:28 
I was complie your demoDlg with Visual Studio 6.0 SP6. But I cannot run at all. (There's a hundred of warning and some of errors. The error is kind of redefinition- so I degug it all. But even I debuged all errors, the program wasn't run normally)
Is there any method to run at Visual Studio 6.0?
 
plz make a DemoFile or SourceFile for Visual Studio 6.0 users.
I'll wait your reply.
AnswerRe: I have a quetion..memberDave Calkins25 Jul '07 - 9:37 
I don't even have a machine with VS 6 installed. I wrote and tested it with VS 2003, sorry Frown | :-(

GeneralRe: I have a quetion..memberMember #40807781 Feb '08 - 16:01 
I have run it in my VC++6.0.
But I only use the CMultilineList class. Smile | :)
GeneralRe: I have a quetion..memberwqq071211 Jan '10 - 22:56 
I have run it in my VC++6 too.
i modify some code,and now,it work fine..
thank you very much!
Questionlooks good, just one problem, won't compilememberyuban16 May '07 - 9:05 
I tried building this with Visual Studio v8.0.5 and the file "MultilineList.cpp" won't compile because 'x1' appears undeclared. Hard to say why exactly this worked for anyone else.
 
I tried simply declaring 'x' immediately above the for-loop at line 1268, and everything compiled, but there is no horizontal bar drawn between lines. This makes the list unusable unless I can track down what exactly 'x1' is supposed to be set to.
 
The code is very clean, but a little too tricky to immediately discern how 'x1' is supposed to be manipulated. Obviously this is the left side of the horizontal line, but its getting set to such a large value now that no horizontal line appears.
 
If anyone has used this control and can offer a suggestion it would be greatly appreciated. As it is, I'm going to hack at the code until I get it to work correctly.
 
Other than this detail ( which I've seen a lot in samples I've downloaded lately from Code Project ) the control is very, very cool.

 
- yuban, gmarkyoung@gmail.com
AnswerRe: looks good, just one problem, won't compilememberyuban16 May '07 - 9:35 
oops. me again. First of all I specified 'x' instead of 'x1' in my msg. Also, 'x1' turns out to be the right side of horizontal line, not the left side.
 
In either case, I now have sensible values for drawing the horizontal line, but no horizontal line is drawn between cells.
 
Well. Gosh. Looks like such a nice control, I'd love to use it. Unfortunately there is no obvious explanation for why horizontal lines are not being drawn. Stepping through the code it looks like the lines should be being drawn, nothing looks wrong.
 
Going to have to punt on using this control. Too bad. It looked promising.

GeneralRe: looks good, just one problem, won't compilemembercmdrew18 May '07 - 11:52 
This seems like a scoping issue under VS2005 being more strict than in previous compilers. X1 is declared by the for loop but is only valid within the for loop and therefore the code will not compile. I changed a few lines as shown below:
 
// for each column
int col;
int x1;
for (col = 0, x1 = r.left-m_viewXPos; (col < m_nCols); col++)
{
 
and it built and ran correctly with all lines drawn. If you just declare x1 at the top of the function you getwarnings about different scopes and the control doesn't draw the horizontal grid lines.
 

GeneralRe: looks good, just one problem, won't compilememberdzolee18 Jun '07 - 7:48 
exactly, a scope thing in VS2k5.
need to declare the vars outside the for statement, or re-declare them in the next for. whichever you like more. Smile | :)
GeneralRe: looks good, just one problem, won't compilememberDave Calkins25 Jul '07 - 9:36 
Thanks for catching that! I only compiled the code under VS2003 and yes, in VS2005 they became more compliant with the language rules Smile | :) oops!
GeneralRight Click Supportmembercristov11 Feb '07 - 17:11 
I was considering using this in a program of mine but I need to be able to support right click as well. I haven't read the custom control docs yet so wasn't sure how easy it is to extend it to support it yet but if you could post an update that would be great. Or possibly give me some info on how to receive the right click event?
QuestionAny way to align the column data?memberunivega_r30416 Nov '06 - 8:19 
Any way to align the column data? (I.E. in your screenshot it would be nice to see the quantity amounts centered for that column.)
AnswerRe: Any way to align the column data?memberSteve Mayfield16 Nov '06 - 11:02 
int nCol;
LVCOLUMN pColumn;
 
nCol = 1;
::GetColumn(nCol, &pColumn);
pColumn.fmt = LVCFMT_CENTER;
::SetColumn(nCol, &pColumn);
 
Note: the leftmost column cannot be changed - it is always left justified.

 
Steve
GeneralRe: Any way to align the column data?memberunivega_r30416 Nov '06 - 15:43 
Actually you can align the cell text any way you like (including the first column) with some slight modification to the code. I found the solution with a little bit of research...
 
In MultilineList.cpp search for the RenderContent(CDC & dc, CRect & r) function and find these lines of code and change DT_LEFT to DT_CENTER or DT_RIGHT to align the cell text:
 
// render the cell text
dc.DrawTextEx(cell.m_text,textRect,
DT_LEFT|DT_NOPREFIX|DT_TOP|DT_WORDBREAK,
NULL);
 
Keep in mind that this small adjustment will change all cells rendered, but will a little more code I'm certain that each individual cell can be aligned however you wish no matter what column it is in.
 
This control is perfect for something I am working on and I'll be attempting just that. I'll also be modifiying it automatically set the number of columns & rows versus setting it manually as it is done in the demo.
GeneralRe: Any way to align the column data?membergetcode_30 Aug '12 - 23:41 
Thank you. It works!
Questiongood bat make black under line to row, how screenshot?membermicrobit7 Sep '06 - 1:22 
good, bat make black under line to row, how screenshot?
 
microbit
AnswerRe: good bat make black under line to row, how screenshot?memberDave Calkins12 Sep '06 - 10:46 
Sorry, I don't understand your question. If you follow the example code and/or run the demo project, you should see gridlines like in the screen shot.
GeneralRe: good bat make black under line to row, how screenshot?membermicrobit23 Sep '06 - 9:12 
Sory i'm run demo and not see gridlines on under row.
GeneralRe: good bat make black under line to row, how screenshot?membermicrobit23 Sep '06 - 9:21 
run demo source in vc2005 of corse.
GeneralExcellentmember.rich.w5 Sep '06 - 10:41 
Excellent control, i'll be sure to use this sooner or later.
 
A few things to make it slightly more 'complete':
 
- options to remove grid lines, or change their colour
- multi-selection
- moving up/down list with arrow keys
 
Keep up the good work
 
Rich
GeneralRe: ExcellentmemberDave Calkins12 Sep '06 - 10:47 
Thanks Smile | :) Good ideas, I'll note them for the next version.
GeneralExcellent indeedmemberHenkka29 Apr '08 - 1:27 
Finally, I've been struggling at least last few hours of trying to get my CListCtrl to display multiline cells. This control sure helped me a lot so thank you very much of this brilliant code!
GeneralResize issuememberTodd Smith5 Sep '06 - 8:49 
If you expand the Description column to way out in right field so you have a single row height, scroll to the far right then resize the main window until the scrollbar disappears you're left with a bit of a mess.
 
I would also suggest a tooltip for partially obscured text.
 

 
Todd Smith

GeneralRe: Resize issuemembervik2011 Sep '06 - 20:44 
An over all good utility. But would require some rework and addition of some more feature to make it reusable
 
vikram
http://www.vikramlakhotia.com/

GeneralRe: Resize issuememberDave Calkins12 Sep '06 - 10:52 
Thanks Smile | :) wrt reuse, you should be able to drop it into your project and use it as is using the example code. I'm sure there's plenty of room for improvement though. Anything more specific wrt additional features?
GeneralRe: Resize issuememberDave Calkins12 Sep '06 - 10:48 
Good catch! I'll take a look at the wierdness you're describing. wrt your tooltip suggestion, are you saying any cell which is not completely visible should have a mouse-over tooltip containing the full text of that cell?

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 5 Sep 2006
Article Copyright 2006 by Dave Calkins
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid