Solved

CString alignment CListBox

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Include multiple hostnames in this command? 3 55
Generic progress indicator 6 117
countEvens challenge 2 100
only14 challenge 19 76
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…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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