Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multiple column listbox

Posted on 1998-03-07
12
Medium Priority
?
385 Views
Last Modified: 2012-06-22
Hi!
I've two tiny questions.
1-I need a multiple column listbox in my project.Is there
any free ocx that can solve my problem?
2-I use the crystal reports ocx in my project.
I tried to register that by Modem but I didn'd succeed.I want to distribute my application, Is that really necesary?
I tried to install my application but the system hanged.
Is that the reason?             thank you
0
Comment
Question by:nima
[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
  • 4
  • 3
  • 3
  • +1
12 Comments
 
LVL 8

Expert Comment

by:mrmick
ID: 1458640
For the multicolumn listbox, check out the following URL:

http://home.sprynet.com/sprynet/rasanen/vbnet/default.htm

Click "Code Library" on the left, "List & Combo" on the center left, and finally, scroll down on and click on "How to Set Tabstops in a Listbox".  You will find a code example using a normal VB listbox.

In regard to the CR question.  You are not required to register any product you own in order to use or distribute it as long as you have the right to distribute granted in the license agreement.  You are free to distribute the CR that comes with VB (assuming you own VB).

0
 
LVL 8

Expert Comment

by:mrmick
ID: 1458641
Whoops, I suppose I should have added: "Not registering CR isn't the reason your system hung."
0
 

Author Comment

by:nima
ID: 1458642
I actually can do that without using api But I need something
like access list  and combo boxes.with separating lines and
headers.
0
Independent Software Vendors: 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!

 

Expert Comment

by:icesurfer
ID: 1458643
u can use the ms flexgrid
0
 

Expert Comment

by:icesurfer
ID: 1458644
or you can concatenate the different data items into
one string and then add that string to a single column
vb list box..
0
 

Author Comment

by:nima
ID: 1458645
The msflexgrid needs a lot of resources and the string cancatenating is not the solution because I need headlines.
so thank you for your answers.
0
 

Expert Comment

by:icesurfer
ID: 1458646
this a list control from www.farpoint.com which can make multiple columns..
try it..i think its what u want..
0
 

Author Comment

by:nima
ID: 1458647
Hi ! icesurfer
Unfortunately I couldn't find any control there.Would you please
be more specific.
                    thank you
0
 
LVL 5

Accepted Solution

by:
nebeker earned 400 total points
ID: 1458648
Why don't you just use the ListView control that's part of Windows?  Just set it to "Report" mode, and you'll get listbox-like functionality, and headers for each column.  In addition, you'll get dynamically resizeable columns.

You can also make the ListView look completely like a listbox by turning on the full row select flag (so the highlight bar extends across all of the columns, instead of the default, which is to just highlight the first column).
0
 

Author Comment

by:nima
ID: 1458649
Thanks a lot for your help.It's exactly what I need.
I just don't know where is that full row selected flag.
I'll appreciate it.
0
 
LVL 5

Expert Comment

by:nebeker
ID: 1458650
Here's some code:

' Change the ListView control to the "Full Row Select" mode, so
' it will act more like a list box...  This style is not
' documented, but the flag exists in the COMMCTRL.H C++
' header file...
'
Call SendMessage(List1.hWnd, LVM_SETSTYLE, 0, LVS_FULLROW)

------
You'll need the following declarations:

' These constants are used to set the full-row select style
' for the ListView...
'
Private Const LVS_FULLROW   As Long = &H20
Private Const LVM_FIRST     As Long = &H1000
Private Const LVM_SETSTYLE  As Long = LVM_FIRST + 54
Private Const LVM_GETSTYLE  As Long = LVM_FIRST + 55

' Declaration of the Win32 API "SendMessage"...
'
Private Declare Function SendMessage Lib "user32" Alias
      "SendMessageA" _
      (ByVal hWnd As Long, ByVal Message As Long, _
       ByVal wParam As Long, ByVal lParam As Long) As Long


0
 
LVL 5

Expert Comment

by:nebeker
ID: 1458651
Another note:

   Call the code I previously posted in your Form Load procedure.  If you want to change the Listview's style in the middle of the program (or turn it off and then back on), you'll
need to call SendMessage using the LVM_GETSTYLE message first, otherwise you'll lose the existing style flags.

For example, to turn off the full row select:

Dim rc as Long
rc = SendMessage( List1.hWnd, LVM_GETSTYLE, 0, 0)
rc = rc Xor LVS_FULLROW
SendMessage( List1.hWnd, LVM_SETSTYLE, 0, rc )

To turn it back on:
rc = SendMessage( List1.hWnd, LVM_GETSTYLE, 0, 0)
rc = rc Or LVS_FULLROW
SendMessage( List1.hWnd, LVM_SETSTYLE, 0, rc )


0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

721 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