Solved

CString alignment CListBox

Posted on 2001-06-07
3
628 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now