Solved

CString alignment CListBox

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

18 Experts available now in Live!

Get 1:1 Help Now