Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

CString alignment CListBox

Posted on 2001-06-07
3
633 Views
Last Modified: 2013-11-20
I wanted a multicolumn listbox, but then
discovered that you can't have vertical scrolling in
a multicolomn listbox.  Thought about using a list
control but I need to have drag and drop (CDragListBox)
inside the listbox and there doesn't appear to be a
CDragListCtrl class. Or is there?

So finally thought I would align the columns, in a
normal single column listbox,  by using tabs.  
Something like

CString str1;
CString str2;
CString str3;
CString myTab = "\t";

str3 = str1 + myTab + str2;

m_pListBox.AddString(str3);

Although it works is it right or should I be
using SetTabStop at  the outset to set the tabs?  
How?  Where?

Although the text appears on a single line is there
any way to allow the user to edit the text in each
pseudo coloum?


FlipFlop


0
Comment
Question by:FlipFlop
3 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 6163273
u wanna dragAndDrop inside the list control or from outside to the list?
0
 
LVL 1

Accepted Solution

by:
hsdhina earned 40 total points
ID: 6165219
Hi,
  Consider a dialog "DLG" having.  Add the API DragAcceptFiles ( HWND, BOOL ) in the
DLG::OnInitDialog () function. When some user drops files over the dialog WM_DROP files messgae will be sent. You can handle this messgae to receive the name of the files.

  You can try the second one by having a ownerdrawn listbox. When User clicks on a particular column create an edit box on that location and if user clicks on some other column get the text from the edit box, destroy the editbox and repaint the row that is selected by user.

0
 

Author Comment

by:FlipFlop
ID: 6176218
Hi,

Thanks for the comment.

Could you expand a little more on the ownerdrawn
listbox?  Sounds interesting but there appears to be
limited information available in MSDN.  Any pointers to
other sources or code examples?

Cheers, FlipFlop

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 65
sum28 challenge 31 115
mapBully challenge 6 151
firstChar challenge 13 119
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question