Solved

CString alignment CListBox

Posted on 2001-06-07
3
637 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
[X]
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
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

696 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